aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorBen Werbowyj <ben.werbowyj@gmail.com>2016-07-22 00:33:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 07:56:04 -0400
commitaaf16f7d98fedb24099361492821fcdc77036eab (patch)
tree19dd5ac9a43480ecc6c8ad11acae80a90f57989d /drivers/w1
parentd4c3f97a062969ce52ecc5428e3dbbe93c157dd2 (diff)
drivers: w1: removed assignment from within if statement
Assignment of variable count removed from within an if statment. This was done at two locations in the file. Signed-off-by: Ben Werbowyj <ben.werbowyj@gmail.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/slaves/w1_therm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index efe9d2154a1a..83a5036b990b 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -335,7 +335,8 @@ static inline int w1_DS18B20_precision(struct device *device, int val)
335 335
336 /* read values to only alter precision bits */ 336 /* read values to only alter precision bits */
337 w1_write_8(dev, W1_READ_SCRATCHPAD); 337 w1_write_8(dev, W1_READ_SCRATCHPAD);
338 if ((count = w1_read_block(dev, rom, 9)) != 9) 338 count = w1_read_block(dev, rom, 9);
339 if (count != 9)
339 dev_warn(device, "w1_read_block() returned %u instead of 9.\n", count); 340 dev_warn(device, "w1_read_block() returned %u instead of 9.\n", count);
340 341
341 crc = w1_calc_crc8(rom, 8); 342 crc = w1_calc_crc8(rom, 8);
@@ -493,7 +494,8 @@ static ssize_t w1_slave_show(struct device *device,
493 if (!w1_reset_select_slave(sl)) { 494 if (!w1_reset_select_slave(sl)) {
494 495
495 w1_write_8(dev, W1_READ_SCRATCHPAD); 496 w1_write_8(dev, W1_READ_SCRATCHPAD);
496 if ((count = w1_read_block(dev, rom, 9)) != 9) { 497 count = w1_read_block(dev, rom, 9);
498 if (count != 9) {
497 dev_warn(device, "w1_read_block() " 499 dev_warn(device, "w1_read_block() "
498 "returned %u instead of 9.\n", 500 "returned %u instead of 9.\n",
499 count); 501 count);