Skip to contentSkip to conversation

usb: fix wait_ms declaration

PATCH New Jean-Christophe PLAGNIOL-VILLARD 3 participants 3 messages Dec 13, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: fix wait_ms declaration

common/usb.c +0 -10
index ee18152..3ed2e34 100644
@@ -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
  */
include/usb.h +6 -0
index 510df95..f97c58a 100644
@@ -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);
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 usb: fix wait_ms declaration

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <[email protected]> you wrote:
...

include/usb.h int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer, · line 245

Quoted 3 lines
include/usb.h +3 -0
+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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is much easier to suggest solutions when you know nothing
#2 lore raw

PATCH 1/1 usb: fix wait_ms declaration

2008/12/13 Wolfgang Denk <[email protected]>:

Quoted 9 lines

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <[email protected]> you wrote:
...

include/usb.h int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer, · line 245

Quoted 3 lines
include/usb.h +3 -0
+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