linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-inno-usb2: remove redundant assignment to variable delay
@ 2021-12-11 18:00 Colin Ian King
  2021-12-14  9:15 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2021-12-11 18:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner, linux-phy,
	linux-arm-kernel, linux-rockchip
  Cc: kernel-janitors, linux-kernel

Variable delay is being assigned to zero and the code falls through to
the next case in a switch statement that returns out of the function.
The variable is never read in this scenario and so the assignment is
redundant and can be removed.

Cleans up scan-build static analysis warning:
drivers/phy/rockchip/phy-rockchip-inno-usb2.c:753:3: warning: Value
stored to 'delay' is never read [deadcode.DeadStores]

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

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 1938365abbb3..9f95b587e2c0 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -750,7 +750,6 @@ static void rockchip_chg_detect_work(struct work_struct *work)
 		fallthrough;
 	case USB_CHG_STATE_SECONDARY_DONE:
 		rphy->chg_state = USB_CHG_STATE_DETECTED;
-		delay = 0;
 		fallthrough;
 	case USB_CHG_STATE_DETECTED:
 		/* put the controller in normal mode */
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] phy: rockchip-inno-usb2: remove redundant assignment to variable delay
  2021-12-11 18:00 [PATCH] phy: rockchip-inno-usb2: remove redundant assignment to variable delay Colin Ian King
@ 2021-12-14  9:15 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-12-14  9:15 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Kishon Vijay Abraham I, Heiko Stuebner, linux-phy,
	linux-arm-kernel, linux-rockchip, kernel-janitors, linux-kernel

On 11-12-21, 18:00, Colin Ian King wrote:
> Variable delay is being assigned to zero and the code falls through to
> the next case in a switch statement that returns out of the function.
> The variable is never read in this scenario and so the assignment is
> redundant and can be removed.
> 
> Cleans up scan-build static analysis warning:
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c:753:3: warning: Value
> stored to 'delay' is never read [deadcode.DeadStores]

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-12-14  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11 18:00 [PATCH] phy: rockchip-inno-usb2: remove redundant assignment to variable delay Colin Ian King
2021-12-14  9:15 ` Vinod Koul

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