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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -367,17 +367,6 @@ struct usb_bus { · 366 unmodified lines | |||
| 367 | 367 | ||
| 368 | /* ----------------------------------------------------------------------- */ | 368 | /* ----------------------------------------------------------------------- */ |
| 369 | 369 | ||
| 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 | |||
| 381 | struct usb_tt; | 370 | struct usb_tt; |
| 382 | 371 | ||
| 383 | enum usb_device_removable { | 372 | enum usb_device_removable { |