Skip to content

Commit

Permalink
drivers: w1: removed assignment from within if statement
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Werbowyj authored and Greg Kroah-Hartman committed Aug 31, 2016
1 parent d4c3f97 commit aaf16f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/w1/slaves/w1_therm.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ static inline int w1_DS18B20_precision(struct device *device, int val)

/* read values to only alter precision bits */
w1_write_8(dev, W1_READ_SCRATCHPAD);
if ((count = w1_read_block(dev, rom, 9)) != 9)
count = w1_read_block(dev, rom, 9);
if (count != 9)
dev_warn(device, "w1_read_block() returned %u instead of 9.\n", count);

crc = w1_calc_crc8(rom, 8);
Expand Down Expand Up @@ -493,7 +494,8 @@ static ssize_t w1_slave_show(struct device *device,
if (!w1_reset_select_slave(sl)) {

w1_write_8(dev, W1_READ_SCRATCHPAD);
if ((count = w1_read_block(dev, rom, 9)) != 9) {
count = w1_read_block(dev, rom, 9);
if (count != 9) {
dev_warn(device, "w1_read_block() "
"returned %u instead of 9.\n",
count);
Expand Down

0 comments on commit aaf16f7

Please sign in to comment.