mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB
The USB descriptor sizes are specified as 16-bit for idVendor / idProduct, and 8-bit for bInterfaceClass / bInterfaceSubClass / bInterfaceProtocol. Doing so we reduce the usbredir_raw_serial_ids[] and usbredir_ftdi_serial_ids[] arrays from 16KiB to 6KiB (size reported on x86_64 host, building with --extra-cflags=-Os). Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a9d8ba2be5
commit
092b6d1e88
2 changed files with 15 additions and 11 deletions
|
@ -22,10 +22,10 @@ static bool usb_id_match(const struct usb_device_id *ids,
|
|||
uint8_t interface_protocol) {
|
||||
int i;
|
||||
|
||||
for (i = 0; ids[i].vendor_id != -1; i++) {
|
||||
for (i = 0; ids[i].terminating_entry == 0; i++) {
|
||||
if (ids[i].vendor_id == vendor_id &&
|
||||
ids[i].product_id == product_id &&
|
||||
(ids[i].interface_class == -1 ||
|
||||
(ids[i].interface_protocol_used == 0 ||
|
||||
(ids[i].interface_class == interface_class &&
|
||||
ids[i].interface_subclass == interface_subclass &&
|
||||
ids[i].interface_protocol == interface_protocol))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue