Skip to contentSkip to conversation

hw/timer: Move extern declaration from .c to .h file

PATCH Superseded Stefan Weil 2 participants 2 messages Jul 7, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/timer: Move extern declaration from .c to .h file

This fixes a warning from smatch (static code analyser).

---
 hw/timer/tusb6010.c |    3 ---
 include/hw/usb.h    |    4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)
hw/timer/tusb6010.c +0 -3
index a281567..4e8f053 100644
@@ -282,9 +282,6 @@ static void tusb_gpio_intr_update(TUSBState *s)
     /* TODO: How is this signalled?  */
 }
 
-extern CPUReadMemoryFunc * const musb_read[];
-extern CPUWriteMemoryFunc * const musb_write[];
-
 static uint32_t tusb_async_readb(void *opaque, hwaddr addr)
 {
     TUSBState *s = (TUSBState *) opaque;
include/hw/usb.h +4 -0
index 8bcab48..e68e57e 100644
@@ -467,6 +467,10 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream);
 void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
 int set_usb_string(uint8_t *buf, const char *str);
 
+/* hcd-musb.c */
+extern CPUReadMemoryFunc * const musb_read[];
+extern CPUWriteMemoryFunc * const musb_write[];
+
 /* usb-linux.c */
 USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
 void usb_host_info(Monitor *mon, const QDict *qdict);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 27 lines · Stefan Weil

This fixes a warning from smatch (static code analyser).

---
 hw/timer/tusb6010.c |    3 ---
 include/hw/usb.h    |    4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)
hw/timer/tusb6010.c +0 -3
index a281567..4e8f053 100644
@@ -282,9 +282,6 @@ static void tusb_gpio_intr_update(TUSBState *s)
     /* TODO: How is this signalled?  */
 }
 
-extern CPUReadMemoryFunc * const musb_read[];
-extern CPUWriteMemoryFunc * const musb_write[];
-
 static uint32_t tusb_async_readb(void *opaque, hwaddr addr)
 {
     TUSBState *s = (TUSBState *) opaque;
include/hw/usb.h +0 -0
index 8bcab48..e68e57e 100644

include/hw/usb.h void usb_wakeup(USBEndpoint *ep, unsigned int stream); · line 476

Quoted 10 lines
include/hw/usb.h +4 -0
@@ -467,6 +467,10 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream);
 void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
 int set_usb_string(uint8_t *buf, const char *str);
 
+/* hcd-musb.c */
+extern CPUReadMemoryFunc * const musb_read[];
+extern CPUWriteMemoryFunc * const musb_write[];
+
 /* usb-linux.c */
 USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
 void usb_host_info(Monitor *mon, const QDict *qdict);

This should go in the existing section for functions and defines from this source file (which is mis-commented as "/* usb-musb.c */" following a file renaming, I see).

(It's also a pretty foul API but I think that largely follows from MUSB never having been qdevified or QOMified.)

thanks
-- PMM