aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/usb/musb/musb_core.c
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omp.ru>2022-06-18 15:06:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-21 16:39:16 +0200
commit196a58bdec7c324d6d862cba19069b77ddd48b90 (patch)
tree9cc5af5bef9ec63b882ab7a8f7e75754dbd9247f /drivers/usb/musb/musb_core.c
parentusb: renesas: Fix refcount leak bug (diff)
downloadwireguard-linux-196a58bdec7c324d6d862cba19069b77ddd48b90.tar.xz
wireguard-linux-196a58bdec7c324d6d862cba19069b77ddd48b90.zip
usb: musb: core: drop redundant checks
In musb_{save|restore}_context() the expression '&musb->endpoints[i]' just cannot be NULL, so the checks have no sense at all -- after dropping them, the local variables 'hw_ep' are no longer necessary, so drop them as well. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Link: https://lore.kernel.org/r/3f8f60d9-f1b5-6b2c-1222-39b156151a22@omp.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r--drivers/usb/musb/musb_core.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f7b1d5993f8c..bbbcfd49fb35 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2684,13 +2684,7 @@ static void musb_save_context(struct musb *musb)
musb->context.devctl = musb_readb(musb_base, MUSB_DEVCTL);
for (i = 0; i < musb->config->num_eps; ++i) {
- struct musb_hw_ep *hw_ep;
-
- hw_ep = &musb->endpoints[i];
- if (!hw_ep)
- continue;
-
- epio = hw_ep->regs;
+ epio = musb->endpoints[i].regs;
if (!epio)
continue;
@@ -2765,13 +2759,7 @@ static void musb_restore_context(struct musb *musb)
musb_writeb(musb_base, MUSB_DEVCTL, musb->context.devctl);
for (i = 0; i < musb->config->num_eps; ++i) {
- struct musb_hw_ep *hw_ep;
-
- hw_ep = &musb->endpoints[i];
- if (!hw_ep)
- continue;
-
- epio = hw_ep->regs;
+ epio = musb->endpoints[i].regs;
if (!epio)
continue;