* [PATCH] hwmon: (asc7621): remove redundant assignment to newval
@ 2017-10-18 12:10 ` Colin King
0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-10-18 12:10 UTC (permalink / raw)
To: George Joseph, Jean Delvare, Guenter Roeck, linux-hwmon
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The setting of newval to zero is redundant as the following if/else
stanzas will always update newval to a new value. Remove the
redundant setting, cleans up clang build warning:
drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is
never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/hwmon/asc7621.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c
index 4875e99b59c9..6d34c05a4f83 100644
--- a/drivers/hwmon/asc7621.c
+++ b/drivers/hwmon/asc7621.c
@@ -579,7 +579,6 @@ static ssize_t show_pwm_enable(struct device *dev,
mutex_unlock(&data->update_lock);
val = config | (altbit << 3);
- newval = 0;
if (val == 3 || val >= 10)
newval = 255;
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] hwmon: (asc7621): remove redundant assignment to newval
@ 2017-10-18 12:10 ` Colin King
0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-10-18 12:10 UTC (permalink / raw)
To: George Joseph, Jean Delvare, Guenter Roeck, linux-hwmon
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The setting of newval to zero is redundant as the following if/else
stanzas will always update newval to a new value. Remove the
redundant setting, cleans up clang build warning:
drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is
never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/hwmon/asc7621.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c
index 4875e99b59c9..6d34c05a4f83 100644
--- a/drivers/hwmon/asc7621.c
+++ b/drivers/hwmon/asc7621.c
@@ -579,7 +579,6 @@ static ssize_t show_pwm_enable(struct device *dev,
mutex_unlock(&data->update_lock);
val = config | (altbit << 3);
- newval = 0;
if (val = 3 || val >= 10)
newval = 255;
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: hwmon: (asc7621): remove redundant assignment to newval
2017-10-18 12:10 ` Colin King
@ 2017-10-21 15:57 ` Guenter Roeck
-1 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2017-10-21 15:57 UTC (permalink / raw)
To: Colin Ian King
Cc: George Joseph, Jean Delvare, linux-hwmon, kernel-janitors, linux-kernel
On Wed, Oct 18, 2017 at 01:10:38PM +0100, Colin Ian King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The setting of newval to zero is redundant as the following if/else
> stanzas will always update newval to a new value. Remove the
> redundant setting, cleans up clang build warning:
>
> drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is
> never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> drivers/hwmon/asc7621.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c
> index 4875e99b59c9..6d34c05a4f83 100644
> --- a/drivers/hwmon/asc7621.c
> +++ b/drivers/hwmon/asc7621.c
> @@ -579,7 +579,6 @@ static ssize_t show_pwm_enable(struct device *dev,
> mutex_unlock(&data->update_lock);
>
> val = config | (altbit << 3);
> - newval = 0;
>
> if (val == 3 || val >= 10)
> newval = 255;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hwmon: (asc7621): remove redundant assignment to newval
@ 2017-10-21 15:57 ` Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2017-10-21 15:57 UTC (permalink / raw)
To: Colin Ian King
Cc: George Joseph, Jean Delvare, linux-hwmon, kernel-janitors, linux-kernel
On Wed, Oct 18, 2017 at 01:10:38PM +0100, Colin Ian King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The setting of newval to zero is redundant as the following if/else
> stanzas will always update newval to a new value. Remove the
> redundant setting, cleans up clang build warning:
>
> drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is
> never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> drivers/hwmon/asc7621.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c
> index 4875e99b59c9..6d34c05a4f83 100644
> --- a/drivers/hwmon/asc7621.c
> +++ b/drivers/hwmon/asc7621.c
> @@ -579,7 +579,6 @@ static ssize_t show_pwm_enable(struct device *dev,
> mutex_unlock(&data->update_lock);
>
> val = config | (altbit << 3);
> - newval = 0;
>
> if (val = 3 || val >= 10)
> newval = 255;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-21 15:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 12:10 [PATCH] hwmon: (asc7621): remove redundant assignment to newval Colin King
2017-10-18 12:10 ` Colin King
2017-10-21 15:57 ` Guenter Roeck
2017-10-21 15:57 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.