w1: ds2413: fix state byte comparision
authorMariusz Bialonczyk <manio@skyboo.net>
Thu, 30 May 2019 07:51:25 +0000 (09:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jun 2019 14:15:21 +0000 (16:15 +0200)
commitaacd152ecd7b18af5d2d96dea9e7284c1c93abea
tree8f9cddd2386e64458cc32367c218f4baa1cc014f
parent7e706da35a458f4b0d4c565c7b71023d8bfe279b
w1: ds2413: fix state byte comparision

This commit is fixing a smatch warning:
drivers/w1/slaves/w1_ds2413.c:61 state_read() warn: impossible condition '(*buf == 255) => ((-128)-127 == 255)'
by creating additional u8 variable for the bus reading and comparision

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 3856032a0628 ("w1: ds2413: when the slave is not responding during read, select it again")
Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/slaves/w1_ds2413.c