1 From 7566655c9e659e890f44784a6403de98ad77ae5b Mon Sep 17 00:00:00 2001
2 From: Colin Ian King <colin.king@canonical.com>
3 Date: Tue, 19 May 2020 16:45:53 +0100
4 Subject: [PATCH] w1_therm: remove redundant assignments to variable
7 commit f37d13d52c0560bd2bac40b22466af538e61a5ce upstream.
9 The variable ret is being initialized with a value that is never read
10 and it is being updated later with a new value. The initialization
11 is redundant and can be removed.
13 Addresses-Coverity: ("Unused value")
14 Signed-off-by: Colin Ian King <colin.king@canonical.com>
15 Link: https://lore.kernel.org/r/20200519154553.873413-1-colin.king@canonical.com
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 drivers/w1/slaves/w1_therm.c | 8 ++++----
19 1 file changed, 4 insertions(+), 4 deletions(-)
21 --- a/drivers/w1/slaves/w1_therm.c
22 +++ b/drivers/w1/slaves/w1_therm.c
23 @@ -505,7 +505,7 @@ static inline int w1_DS18S20_write_data(
25 static inline int w1_DS18B20_set_resolution(struct w1_slave *sl, int val)
29 u8 new_config_register[3]; /* array of data to be written */
30 struct therm_info info;
32 @@ -538,7 +538,7 @@ static inline int w1_DS18B20_set_resolut
34 static inline int w1_DS18B20_get_resolution(struct w1_slave *sl)
39 struct therm_info info;
41 @@ -1499,7 +1499,7 @@ static ssize_t alarms_show(struct device
42 struct device_attribute *attr, char *buf)
44 struct w1_slave *sl = dev_to_w1_slave(device);
48 struct therm_info scratchpad;
50 @@ -1523,7 +1523,7 @@ static ssize_t alarms_store(struct devic
51 struct w1_slave *sl = dev_to_w1_slave(device);
52 struct therm_info info;
53 u8 new_config_register[3]; /* array of data to be written */
54 - int temp, ret = -EINVAL;
57 s8 tl, th, tt; /* 1 byte per value + temp ring order */