* [PATCH] PM / wakeup: remove redundant assignment to variable retval
@ 2021-04-16 12:43 Colin King
2021-04-22 13:26 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-04-16 12:43 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
linux-pm
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable retval 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/base/power/wakeup_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeup_stats.c
index 5ade7539ac02..924fac493c4f 100644
--- a/drivers/base/power/wakeup_stats.c
+++ b/drivers/base/power/wakeup_stats.c
@@ -137,7 +137,7 @@ static struct device *wakeup_source_device_create(struct device *parent,
struct wakeup_source *ws)
{
struct device *dev = NULL;
- int retval = -ENODEV;
+ int retval;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PM / wakeup: remove redundant assignment to variable retval
2021-04-16 12:43 [PATCH] PM / wakeup: remove redundant assignment to variable retval Colin King
@ 2021-04-22 13:26 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-04-22 13:26 UTC (permalink / raw)
To: Colin King
Cc: Rafael J . Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
Linux PM, kernel-janitors, Linux Kernel Mailing List
On Fri, Apr 16, 2021 at 2:44 PM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable retval 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/base/power/wakeup_stats.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeup_stats.c
> index 5ade7539ac02..924fac493c4f 100644
> --- a/drivers/base/power/wakeup_stats.c
> +++ b/drivers/base/power/wakeup_stats.c
> @@ -137,7 +137,7 @@ static struct device *wakeup_source_device_create(struct device *parent,
> struct wakeup_source *ws)
> {
> struct device *dev = NULL;
> - int retval = -ENODEV;
> + int retval;
>
> dev = kzalloc(sizeof(*dev), GFP_KERNEL);
> if (!dev) {
> --
Applied as 5.13 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-22 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 12:43 [PATCH] PM / wakeup: remove redundant assignment to variable retval Colin King
2021-04-22 13:26 ` Rafael J. Wysocki
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).