Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1734195 > unrolled thread

[PATCH] hwmon: (sht15): remove redundant check on status and send of status value

Started byColin King <colin.king@canonical.com>
First post2017-09-18 16:50 +0200
Last post2017-09-18 17:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] hwmon: (sht15): remove redundant check on status and send of status value Colin King <colin.king@canonical.com> - 2017-09-18 16:50 +0200
    Re: [PATCH] hwmon: (sht15): remove redundant check on status and  send of status value Guenter Roeck <linux@roeck-us.net> - 2017-09-18 17:00 +0200

#1734195 — [PATCH] hwmon: (sht15): remove redundant check on status and send of status value

FromColin King <colin.king@canonical.com>
Date2017-09-18 16:50 +0200
Subject[PATCH] hwmon: (sht15): remove redundant check on status and send of status value
Message-ID<ur5x0-7zB-19@gated-at.bofh.it>
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>
---
 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

[toc] | [next] | [standalone]


#1734197 — Re: [PATCH] hwmon: (sht15): remove redundant check on status and send of status value

FromGuenter Roeck <linux@roeck-us.net>
Date2017-09-18 17:00 +0200
SubjectRe: [PATCH] hwmon: (sht15): remove redundant check on status and send of status value
Message-ID<ur5GF-7D9-1@gated-at.bofh.it>
In reply to#1734195
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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web