public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Colin King <colin.king@canonical.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (sht15): remove redundant check on status and send of status value
Date: Mon, 18 Sep 2017 07:51:26 -0700	[thread overview]
Message-ID: <20170918145126.GD11868@roeck-us.net> (raw)
In-Reply-To: <20170918144548.32354-1-colin.king@canonical.com>

On Mon, Sep 18, 2017 at 03:45:48PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> A previous commit removed bit or'ing into to the integer status
> so now status is now always zero. This means that the non-zero check on
> status and the sht15_send_status call will never occur; it is deadcode.
> Clean this up by removing the dead code.
> 
> Detected by: CoverityScan CID#1456835 ("Logically dead code")
> 
> Fixes: aa7ab80c578c ("hwmon: (sht15) Root out platform data")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/sht15.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
> index 0e3e5f83f5cf..25d28343ba93 100644
> --- a/drivers/hwmon/sht15.c
> +++ b/drivers/hwmon/sht15.c
> @@ -925,7 +925,6 @@ static int sht15_probe(struct platform_device *pdev)
>  {
>  	int ret;
>  	struct sht15_data *data;
> -	u8 status = 0;
>  
>  	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>  	if (!data)
> @@ -1002,13 +1001,6 @@ static int sht15_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto err_release_reg;
>  
> -	/* write status with platform data options */
> -	if (status) {
> -		ret = sht15_send_status(data, status);
> -		if (ret)
> -			goto err_release_reg;
> -	}
> -
>  	ret = sysfs_create_group(&pdev->dev.kobj, &sht15_attr_group);
>  	if (ret) {
>  		dev_err(&pdev->dev, "sysfs create failed\n");
> -- 
> 2.14.1
> 

      reply	other threads:[~2017-09-18 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 14:45 [PATCH] hwmon: (sht15): remove redundant check on status and send of status value Colin King
2017-09-18 14:51 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170918145126.GD11868@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=colin.king@canonical.com \
    --cc=jdelvare@suse.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox