mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
usb: fix yellow in eb69211791
Bootloaders with HAVE_USBSTACK but without HAVE_BOOTLOADER_USB_MODE end up with USB_NUM_DRIVERS of 0 which leads to a warning due to a signed number being checked to see if it's >= 0. Work around this temporarily; the proper fix is to not build usb_core and its class drivers when BOOTLOADER & !HAVE_BOOTLOADER_USB_MODE Change-Id: I1b41140d31ba9df6b4c760478c4265d4e5584963
This commit is contained in:
parent
eb69211791
commit
b349eea2c9
1 changed files with 6 additions and 2 deletions
|
|
@ -1182,8 +1182,12 @@ void usb_core_handle_notify(long id, intptr_t data)
|
|||
#endif
|
||||
break;
|
||||
case USB_NOTIFY_CLASS_DRIVER: {
|
||||
uint8_t index = data >> 24;
|
||||
if(index >= USB_NUM_DRIVERS) {
|
||||
/* HACK: index is uint8 but promoted to int to avoid a compiler
|
||||
warning when USB_NUM_DRIVERS is 0, mainly in bootloaders.
|
||||
This hack can be removed once usb_core is no longer built
|
||||
for BOOTLOADER && !HAVE_BOOTLOADER_USB_MODE */
|
||||
int index = data >> 24;
|
||||
if(index < 0 || index >= USB_NUM_DRIVERS) {
|
||||
logf("usb_core: invalid notification destination index=%u", index);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue