kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: i5k_amb: remove redundant assignment to variable res
@ 2020-06-10 12:36 Colin King
  2020-06-10 13:25 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-06-10 12:36 UTC (permalink / raw)
  To: 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 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>
---
 drivers/hwmon/i5k_amb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
index eeac4b04df27..cd5b62905eee 100644
--- a/drivers/hwmon/i5k_amb.c
+++ b/drivers/hwmon/i5k_amb.c
@@ -396,7 +396,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
 
 static int i5k_amb_add(void)
 {
-	int res = -ENODEV;
+	int res;
 
 	/* only ever going to be one of these */
 	amb_pdev = platform_device_alloc(DRVNAME, 0);
-- 
2.27.0.rc0

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

* Re: [PATCH] hwmon: i5k_amb: remove redundant assignment to variable res
  2020-06-10 12:36 [PATCH] hwmon: i5k_amb: remove redundant assignment to variable res Colin King
@ 2020-06-10 13:25 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-06-10 13:25 UTC (permalink / raw)
  To: Colin King; +Cc: Jean Delvare, linux-hwmon, kernel-janitors, linux-kernel

On Wed, Jun 10, 2020 at 01:36:38PM +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 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>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/i5k_amb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
> index eeac4b04df27..cd5b62905eee 100644
> --- a/drivers/hwmon/i5k_amb.c
> +++ b/drivers/hwmon/i5k_amb.c
> @@ -396,7 +396,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
>  
>  static int i5k_amb_add(void)
>  {
> -	int res = -ENODEV;
> +	int res;
>  
>  	/* only ever going to be one of these */
>  	amb_pdev = platform_device_alloc(DRVNAME, 0);

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

end of thread, other threads:[~2020-06-10 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 12:36 [PATCH] hwmon: i5k_amb: remove redundant assignment to variable res Colin King
2020-06-10 13:25 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).