qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/6] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB


From: Philippe Mathieu-Daudé
Subject: [PATCH 3/6] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB
Date: Wed, 4 Mar 2020 23:18:04 +0100

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é <address@hidden>
---
 hw/usb/quirks.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/usb/quirks.h b/hw/usb/quirks.h
index 89480befd7..794d89a356 100644
--- a/hw/usb/quirks.h
+++ b/hw/usb/quirks.h
@@ -21,11 +21,11 @@
 #include "quirks-pl2303-ids.h"
 
 struct usb_device_id {
-    int vendor_id;
-    int product_id;
-    int interface_class;
-    int interface_subclass;
-    int interface_protocol;
+    int16_t vendor_id;
+    int16_t product_id;
+    int8_t interface_class;
+    int8_t interface_subclass;
+    int8_t interface_protocol;
 };
 
 #define USB_DEVICE(vendor, product) \
-- 
2.21.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]