[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
[PATCH 2/6] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss, Philippe Mathieu-Daudé, 2020/03/04
[PATCH 5/6] ui/curses: Make control_characters[] array const, Philippe Mathieu-Daudé, 2020/03/04
[PATCH 4/6] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB, Philippe Mathieu-Daudé, 2020/03/04
[PATCH 6/6] ui/curses: Move arrays to .heap to save 74KiB of .bss, Philippe Mathieu-Daudé, 2020/03/04