mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 20:34:20 +08:00
w1: ds2482: do not use assignment in if condition
Assignments in if condition are less readable and error-prone. Fixes also checkpatch warning: ERROR: do not use assignment in if condition Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230415104304.104134-9-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
076909c24f
commit
787e19ae1f
@ -451,7 +451,8 @@ static int ds2482_probe(struct i2c_client *client)
|
|||||||
I2C_FUNC_SMBUS_BYTE))
|
I2C_FUNC_SMBUS_BYTE))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) {
|
data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL);
|
||||||
|
if (!data) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user