2023-03-14 01:29:00

by Nobuhiro Iwamatsu

[permalink] [raw]
Subject: [PATCH] misc: apds990x: Remove unnecessary return code in apds990x_power_state_show()

In apds990x_power_state_show(), the return value of sprintf is returned, so
'return 0' is unnecessary. This remove 'return 0'.

Fixes: 92b1f84d46b2 ("drivers/misc: driver for APDS990X ALS and proximity sensors")
Cc: [email protected]
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
---
drivers/misc/apds990x.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c
index 0024503ea6db..6de6dc3c122f 100644
--- a/drivers/misc/apds990x.c
+++ b/drivers/misc/apds990x.c
@@ -984,7 +984,6 @@ static ssize_t apds990x_power_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", !pm_runtime_suspended(dev));
- return 0;
}

static ssize_t apds990x_power_state_store(struct device *dev,
--
2.39.2




2023-03-14 06:02:47

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] misc: apds990x: Remove unnecessary return code in apds990x_power_state_show()

On Tue, Mar 14, 2023 at 10:27:32AM +0900, Nobuhiro Iwamatsu wrote:
> In apds990x_power_state_show(), the return value of sprintf is returned, so
> 'return 0' is unnecessary. This remove 'return 0'.
>
> Fixes: 92b1f84d46b2 ("drivers/misc: driver for APDS990X ALS and proximity sensors")
> Cc: [email protected]

Why is this needed for stable kernels? It's dead code removal, no
actual functionality is changed.

thanks,

greg k-h