* [PATCH][next] rtc: class: remove redundant assignment to variable err
@ 2020-04-02 11:04 Colin King
2020-04-02 16:48 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-04-02 11:04 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, linux-rtc
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable err 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/rtc/class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 03d6516941a8..7c88d190c51f 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -48,7 +48,7 @@ int rtc_hctosys_ret = -ENODEV;
static void rtc_hctosys(struct rtc_device *rtc)
{
- int err = -ENODEV;
+ int err;
struct rtc_time tm;
struct timespec64 tv64 = {
.tv_nsec = NSEC_PER_SEC >> 1,
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] rtc: class: remove redundant assignment to variable err
2020-04-02 11:04 [PATCH][next] rtc: class: remove redundant assignment to variable err Colin King
@ 2020-04-02 16:48 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2020-04-02 16:48 UTC (permalink / raw)
To: Colin King; +Cc: Alessandro Zummo, linux-rtc, kernel-janitors, linux-kernel
On 02/04/2020 12:04:11+0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable err 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/rtc/class.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied, thanks.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-02 16:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 11:04 [PATCH][next] rtc: class: remove redundant assignment to variable err Colin King
2020-04-02 16:48 ` Alexandre Belloni
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).