Commit 39bbfdac authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Greg Kroah-Hartman

w1: ds2433: 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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230415104304.104134-7-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 921e0f2f
...@@ -98,7 +98,8 @@ static ssize_t eeprom_read(struct file *filp, struct kobject *kobj, ...@@ -98,7 +98,8 @@ static ssize_t eeprom_read(struct file *filp, struct kobject *kobj,
u8 wrbuf[3]; u8 wrbuf[3];
#endif #endif
if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE);
if (!count)
return 0; return 0;
mutex_lock(&sl->master->bus_mutex); mutex_lock(&sl->master->bus_mutex);
...@@ -208,7 +209,8 @@ static ssize_t eeprom_write(struct file *filp, struct kobject *kobj, ...@@ -208,7 +209,8 @@ static ssize_t eeprom_write(struct file *filp, struct kobject *kobj,
struct w1_slave *sl = kobj_to_w1_slave(kobj); struct w1_slave *sl = kobj_to_w1_slave(kobj);
int addr, len, idx; int addr, len, idx;
if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE);
if (!count)
return 0; return 0;
#ifdef CONFIG_W1_SLAVE_DS2433_CRC #ifdef CONFIG_W1_SLAVE_DS2433_CRC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment