staging: emxx_udc: Make incorrectly defined global static
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sun, 7 Feb 2021 08:59:12 +0000 (14:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2021 09:15:05 +0000 (10:15 +0100)
The global gpio_desc pointer and int vbus_irq were defined in the header,
instead put the definitions in the translation unit and make them static as
there's only a single consumer, and these symbols shouldn't pollute the
global namespace.

This fixes the following sparse warnings for this driver:
drivers/staging/emxx_udc/emxx_udc.c: note: in included file:
drivers/staging/emxx_udc/emxx_udc.h:23:18: warning: symbol 'vbus_gpio' was not
declared. Should it be static?  drivers/staging/emxx_udc/emxx_udc.h:24:5:
warning: symbol 'vbus_irq' was not declared. Should it be static?

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20210207085911.270746-1-memxor@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/emxx_udc/emxx_udc.c
drivers/staging/emxx_udc/emxx_udc.h

index a30b4f5b199b5af9145e49e076d6e7ce0ba21f6a..3536c03ff523596f54560ee31e30b4800de933bd 100644 (file)
@@ -34,6 +34,9 @@
 #define        DRIVER_DESC     "EMXX UDC driver"
 #define        DMA_ADDR_INVALID        (~(dma_addr_t)0)
 
+static struct gpio_desc *vbus_gpio;
+static int vbus_irq;
+
 static const char      driver_name[] = "emxx_udc";
 static const char      driver_desc[] = DRIVER_DESC;
 
index bca614d69acafe9d05f916c66b5429a8554bd995..c9e37a1b8139c1afa4b3614b111c76ff9784c26a 100644 (file)
@@ -20,8 +20,6 @@
 /* below hacked up for staging integration */
 #define GPIO_VBUS 0 /* GPIO_P153 on KZM9D */
 #define INT_VBUS 0 /* IRQ for GPIO_P153 */
-struct gpio_desc *vbus_gpio;
-int vbus_irq;
 
 /*------------ Board dependence(Wait) */