[PATCH 08/12] USB: musb: remove dead stores
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Sep 30 03:20:01 EDT 2020
Reading the interrupt registers has a side-effect, so their value need
not be used for anythig. Storing it into a variable never read
obfuscates this however. Cast to (void) for clarity.
Reported-by: clang-analyzer-10
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/usb/musb/musb_core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 9fdef8679b88..266663a9b0ec 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -330,7 +330,6 @@ void musb_load_testpacket(struct musb *musb)
static void musb_generic_disable(struct musb *musb)
{
void __iomem *mbase = musb->mregs;
- u16 temp;
/* disable interrupts */
musb_writeb(mbase, MUSB_INTRUSBE, 0);
@@ -343,9 +342,9 @@ static void musb_generic_disable(struct musb *musb)
musb_writeb(mbase, MUSB_DEVCTL, 0);
/* flush pending interrupts */
- temp = musb_readb(mbase, MUSB_INTRUSB);
- temp = musb_readw(mbase, MUSB_INTRTX);
- temp = musb_readw(mbase, MUSB_INTRRX);
+ (void)musb_readb(mbase, MUSB_INTRUSB);
+ (void)musb_readw(mbase, MUSB_INTRTX);
+ (void)musb_readw(mbase, MUSB_INTRRX);
}
--
2.28.0
More information about the barebox
mailing list