diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-05-19 16:45:53 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-21 10:58:51 +0200 |
commit | f37d13d52c0560bd2bac40b22466af538e61a5ce (patch) | |
tree | 600d0ded74fdf5ff76a31a58a8d113ab2ef68715 /drivers/w1 | |
parent | e420637b81f78d0fbacf539bdb1b341eba602aea (diff) | |
download | linux-stable-f37d13d52c0560bd2bac40b22466af538e61a5ce.tar.gz linux-stable-f37d13d52c0560bd2bac40b22466af538e61a5ce.tar.bz2 linux-stable-f37d13d52c0560bd2bac40b22466af538e61a5ce.zip |
w1_therm: remove redundant assignments to variable ret
The variable ret is being initialized with a value that is never read
and it is being updated later with a new value. The initialization
is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200519154553.873413-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/slaves/w1_therm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index a6c85e486671..c1b4eda16719 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c @@ -505,7 +505,7 @@ static inline int w1_DS18S20_write_data(struct w1_slave *sl, static inline int w1_DS18B20_set_resolution(struct w1_slave *sl, int val) { - int ret = -ENODEV; + int ret; u8 new_config_register[3]; /* array of data to be written */ struct therm_info info; @@ -538,7 +538,7 @@ static inline int w1_DS18B20_set_resolution(struct w1_slave *sl, int val) static inline int w1_DS18B20_get_resolution(struct w1_slave *sl) { - int ret = -ENODEV; + int ret; u8 config_register; struct therm_info info; @@ -1499,7 +1499,7 @@ static ssize_t alarms_show(struct device *device, struct device_attribute *attr, char *buf) { struct w1_slave *sl = dev_to_w1_slave(device); - int ret = -ENODEV; + int ret; s8 th = 0, tl = 0; struct therm_info scratchpad; @@ -1523,7 +1523,7 @@ static ssize_t alarms_store(struct device *device, struct w1_slave *sl = dev_to_w1_slave(device); struct therm_info info; u8 new_config_register[3]; /* array of data to be written */ - int temp, ret = -EINVAL; + int temp, ret; char *token = NULL; s8 tl, th, tt; /* 1 byte per value + temp ring order */ char *p_args, *orig; |