[U-Boot] [PATCH] usb: fix wait_ms declaration

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/common/usb.c b/common/usb.c index ee18152..3ed2e34 100644 --- a/common/usb.c +++ b/common/usb.c @@ -83,16 +83,6 @@ void usb_hub_reset(void); static int hub_port_reset(struct usb_device *dev, int port, unsigned short *portstat);
-/*********************************************************************** - * wait_ms - */ - -inline void wait_ms(unsigned long ms) -{ - while (ms-- > 0) - udelay(1000); -} - /*************************************************************************** * Init USB Device */ diff --git a/include/usb.h b/include/usb.h index 510df95..f97c58a 100644 --- a/include/usb.h +++ b/include/usb.h @@ -240,6 +240,12 @@ int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer, int cfgno); int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type, unsigned char id, void *buf, int size); +static void __inline__ wait_ms(unsigned long ms) +{ + while(ms-->0) + udelay(1000); +} + int usb_get_class_descriptor(struct usb_device *dev, int ifnum, unsigned char type, unsigned char id, void *buf, int size);

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1229198787-24017-1-git-send-email-plagnioj@jcrosoft.com you wrote: ...
+static void __inline__ wait_ms(unsigned long ms) +{
- while(ms-->0)
White space before and after the '>', please.
And should we not check for a '0' argument first? Of course, you can argument that the caller will just get what he asked for (i. e. a nearly 50 days delay), but anyway.
Best regards,
Wolfgang Denk

2008/12/13 Wolfgang Denk wd@denx.de:
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1229198787-24017-1-git-send-email-plagnioj@jcrosoft.com you wrote: ...
+static void __inline__ wait_ms(unsigned long ms) +{
while(ms-->0)
White space before and after the '>', please.
And white space between while and '(' I assume.
Regards, Magnus
participants (3)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Magnus Lilja
-
Wolfgang Denk