usb: musb: remove unused variable 'count'
authorColin Ian King <colin.i.king@gmail.com>
Thu, 29 Feb 2024 11:55:48 +0000 (11:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Mar 2024 13:25:16 +0000 (13:25 +0000)
The variable count is being initialized and incremented but it is never
actually referenced in any other way. The variable is redundant and can
be removed.

Cleans up clang scan build warning:
drivers/usb/musb/musb_gadget.c:1747:12: warning: variable 'count' set
but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240229115548.218713-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_gadget.c

index 051c6da7cf6d74de81ca35ed186963c2f6c9b01e..55df0ee413d8e21d2d8be634591c2c85aff008fb 100644 (file)
@@ -1744,7 +1744,6 @@ static inline void musb_g_init_endpoints(struct musb *musb)
 {
        u8                      epnum;
        struct musb_hw_ep       *hw_ep;
-       unsigned                count = 0;
 
        /* initialize endpoint list just once */
        INIT_LIST_HEAD(&(musb->g.ep_list));
@@ -1754,17 +1753,14 @@ static inline void musb_g_init_endpoints(struct musb *musb)
                        epnum++, hw_ep++) {
                if (hw_ep->is_shared_fifo /* || !epnum */) {
                        init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 0);
-                       count++;
                } else {
                        if (hw_ep->max_packet_sz_tx) {
                                init_peripheral_ep(musb, &hw_ep->ep_in,
                                                        epnum, 1);
-                               count++;
                        }
                        if (hw_ep->max_packet_sz_rx) {
                                init_peripheral_ep(musb, &hw_ep->ep_out,
                                                        epnum, 0);
-                               count++;
                        }
                }
        }