Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] hwmon: w83793d: remove redundant assignment to variable res
@ 2019-10-11 17:02 Colin King
  2019-10-17 13:39 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-10-11 17:02 UTC (permalink / raw)
  To: Rudolf Marek, Jean Delvare, Guenter Roeck, linux-hwmon
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable res is being initialized with a value that
is never read and is being re-assigned a little later on. The
assignment is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/hwmon/w83793.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 9df48b70c70c..a0307e6761b8 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -2096,7 +2096,7 @@ static struct w83793_data *w83793_update_device(struct device *dev)
 static u8 w83793_read_value(struct i2c_client *client, u16 reg)
 {
 	struct w83793_data *data = i2c_get_clientdata(client);
-	u8 res = 0xff;
+	u8 res;
 	u8 new_bank = reg >> 8;
 
 	new_bank |= data->bank & 0xfc;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: w83793d: remove redundant assignment to variable res
  2019-10-11 17:02 [PATCH] hwmon: w83793d: remove redundant assignment to variable res Colin King
@ 2019-10-17 13:39 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-10-17 13:39 UTC (permalink / raw)
  To: Colin King
  Cc: Rudolf Marek, Jean Delvare, linux-hwmon, kernel-janitors, linux-kernel

On Fri, Oct 11, 2019 at 06:02:15PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable res is being initialized with a value that
> is never read and is being re-assigned a little later on. The
> assignment is redundant and hence can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied. Note that I removed the above Addreddes-Coverity tag as
it doesn't really make much sense.

Guenter

> ---
>  drivers/hwmon/w83793.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
> index 9df48b70c70c..a0307e6761b8 100644
> --- a/drivers/hwmon/w83793.c
> +++ b/drivers/hwmon/w83793.c
> @@ -2096,7 +2096,7 @@ static struct w83793_data *w83793_update_device(struct device *dev)
>  static u8 w83793_read_value(struct i2c_client *client, u16 reg)
>  {
>  	struct w83793_data *data = i2c_get_clientdata(client);
> -	u8 res = 0xff;
> +	u8 res;
>  	u8 new_bank = reg >> 8;
>  
>  	new_bank |= data->bank & 0xfc;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11 17:02 [PATCH] hwmon: w83793d: remove redundant assignment to variable res Colin King
2019-10-17 13:39 ` Guenter Roeck

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org
	public-inbox-index linux-hwmon

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git