linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] pinctrl: ocelot: remove redundant assignment to variable ret
@ 2024-02-23 16:28 Colin Ian King
  2024-02-29 13:38 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-02-23 16:28 UTC (permalink / raw)
  To: Linus Walleij, linux-gpio; +Cc: kernel-janitors, linux-kernel

The variable ret is being assigned a value that is never read, it
is being re-assigned a value in every case statement in the following
switch statement. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/pinctrl/pinctrl-ocelot.c:1404:3: warning: Value stored to 'ret'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/pinctrl/pinctrl-ocelot.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index 52aadd6d72a8..be9b8c010167 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1401,7 +1401,6 @@ static int ocelot_hw_set_value(struct ocelot_pinctrl *info,
 	if (info->pincfg) {
 		const struct ocelot_pincfg_data *opd = info->pincfg_data;
 
-		ret = 0;
 		switch (reg) {
 		case PINCONF_BIAS:
 			ret = ocelot_pincfg_clrsetbits(info, pin,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] pinctrl: ocelot: remove redundant assignment to variable ret
  2024-02-23 16:28 [PATCH][next] pinctrl: ocelot: remove redundant assignment to variable ret Colin Ian King
@ 2024-02-29 13:38 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2024-02-29 13:38 UTC (permalink / raw)
  To: Colin Ian King; +Cc: linux-gpio, kernel-janitors, linux-kernel

On Fri, Feb 23, 2024 at 5:28 PM Colin Ian King <colin.i.king@gmail.com> wrote:

> The variable ret is being assigned a value that is never read, it
> is being re-assigned a value in every case statement in the following
> switch statement. The assignment is redundant and can be removed.
>
> Cleans up clang scan build warning:
> drivers/pinctrl/pinctrl-ocelot.c:1404:3: warning: Value stored to 'ret'
> is never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Patch applied!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-29 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-23 16:28 [PATCH][next] pinctrl: ocelot: remove redundant assignment to variable ret Colin Ian King
2024-02-29 13:38 ` Linus Walleij

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).