Skip to content

Commit 36ff66d

Browse files
AlanSterngregkh
authored andcommitted
USB: move the definition of USB_MAXCHILDREN
The USB_MAXCHILDREN symbol is used in include/uapi/linux/usb/ch11.h, a user-mode header, even though it is defined in include/linux/usb.h, which is kernel-only. This causes compile-time errors when user programs try to #include linux/usb/ch11.h. This patch fixes the problem by moving the definition of USB_MAXCHILDREN into ch11.h. It also gets rid of unneeded parentheses. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 39c2427 commit 36ff66d

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎include/linux/usb.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,6 @@ struct usb_bus {
367367

368368
/* ----------------------------------------------------------------------- */
369369

370-
/* This is arbitrary.
371-
* From USB 2.0 spec Table 11-13, offset 7, a hub can
372-
* have up to 255 ports. The most yet reported is 10.
373-
*
374-
* Current Wireless USB host hardware (Intel i1480 for example) allows
375-
* up to 22 devices to connect. Upcoming hardware might raise that
376-
* limit. Because the arrays need to add a bit for hub status data, we
377-
* do 31, so plus one evens out to four bytes.
378-
*/
379-
#define USB_MAXCHILDREN (31)
380-
381370
struct usb_tt;
382371

383372
enum usb_device_removable {

‎include/uapi/linux/usb/ch11.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111

1212
#include <linux/types.h> /* __u8 etc */
1313

14+
/* This is arbitrary.
15+
* From USB 2.0 spec Table 11-13, offset 7, a hub can
16+
* have up to 255 ports. The most yet reported is 10.
17+
*
18+
* Current Wireless USB host hardware (Intel i1480 for example) allows
19+
* up to 22 devices to connect. Upcoming hardware might raise that
20+
* limit. Because the arrays need to add a bit for hub status data, we
21+
* use 31, so plus one evens out to four bytes.
22+
*/
23+
#define USB_MAXCHILDREN 31
24+
1425
/*
1526
* Hub request types
1627
*/

0 commit comments

Comments
 (0)