From: Colin King <colin.king@canonical.com> To: George Joseph <george.joseph@fairview5.com>, Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: (asc7621): remove redundant assignment to newval Date: Wed, 18 Oct 2017 13:10:38 +0100 [thread overview] Message-ID: <20171018121038.29409-1-colin.king@canonical.com> (raw) 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
WARNING: multiple messages have this Message-ID (diff)
From: Colin King <colin.king@canonical.com> To: George Joseph <george.joseph@fairview5.com>, Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: (asc7621): remove redundant assignment to newval Date: Wed, 18 Oct 2017 12:10:38 +0000 [thread overview] Message-ID: <20171018121038.29409-1-colin.king@canonical.com> (raw) 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
next reply other threads:[~2017-10-18 12:10 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-10-18 12:10 Colin King [this message] 2017-10-18 12:10 ` [PATCH] hwmon: (asc7621): remove redundant assignment to newval Colin King 2017-10-21 15:57 ` Guenter Roeck 2017-10-21 15:57 ` Guenter Roeck
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=20171018121038.29409-1-colin.king@canonical.com \ --to=colin.king@canonical.com \ --cc=george.joseph@fairview5.com \ --cc=jdelvare@suse.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-hwmon@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux@roeck-us.net \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.