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

Nobuhiro Iwamatsu posted 1 patch 2 years, 11 months ago
drivers/misc/apds990x.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] misc: apds990x: Remove unnecessary return code in apds990x_power_state_show()
Posted by Nobuhiro Iwamatsu 2 years, 11 months ago
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: stable@vger.kernel.org
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
---
 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
Re: [PATCH] misc: apds990x: Remove unnecessary return code in apds990x_power_state_show()
Posted by Greg Kroah-Hartman 2 years, 11 months ago
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: stable@vger.kernel.org

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

thanks,

greg k-h