summaryrefslogtreecommitdiff
path: root/drivers/w1/masters
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2023-04-15 12:42:57 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-20 14:15:07 +0200
commit787e19ae1fa96cfbbb943e647253e966b4d53407 (patch)
tree50ede0e316f64244ee8a74fc2e007ea3469f7df6 /drivers/w1/masters
parent076909c24ffa747a56d9c0167c74ee167dd81cd1 (diff)
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>
Diffstat (limited to 'drivers/w1/masters')
-rw-r--r--drivers/w1/masters/ds2482.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index cc5938fb6239..c1de8a92e144 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -451,7 +451,8 @@ static int ds2482_probe(struct i2c_client *client)
I2C_FUNC_SMBUS_BYTE))
return -ENODEV;
- if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) {
+ data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL);
+ if (!data) {
err = -ENOMEM;
goto exit;
}