[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 13/26] hw/usb/desc: Reduce some declarations scope
From: |
Alistair Francis |
Subject: |
Re: [PATCH 13/26] hw/usb/desc: Reduce some declarations scope |
Date: |
Mon, 6 Jul 2020 10:00:56 -0700 |
On Sat, Jul 4, 2020 at 7:59 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> USBDescString is forward-declared. Only bus.c uses the
> usb_device_get_product_desc() and usb_device_get_usb_desc()
> function. Move all that to the "desc.h" header to reduce
> the big "hw/usb.h" header a bit.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/usb/desc.h | 10 ++++++++++
> include/hw/usb.h | 10 ----------
> hw/usb/bus.c | 1 +
> 3 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/hw/usb/desc.h b/hw/usb/desc.h
> index 92594fbe29..4bf6966c4b 100644
> --- a/hw/usb/desc.h
> +++ b/hw/usb/desc.h
> @@ -242,4 +242,14 @@ int usb_desc_get_descriptor(USBDevice *dev, USBPacket *p,
> int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
> int request, int value, int index, int length, uint8_t *data);
>
> +const char *usb_device_get_product_desc(USBDevice *dev);
> +
> +const USBDesc *usb_device_get_usb_desc(USBDevice *dev);
> +
> +struct USBDescString {
> + uint8_t index;
> + char *str;
> + QLIST_ENTRY(USBDescString) next;
> +};
> +
> #endif /* QEMU_HW_USB_DESC_H */
> diff --git a/include/hw/usb.h b/include/hw/usb.h
> index 15b2ef300a..18f1349bdc 100644
> --- a/include/hw/usb.h
> +++ b/include/hw/usb.h
> @@ -192,12 +192,6 @@ typedef struct USBDescOther USBDescOther;
> typedef struct USBDescString USBDescString;
> typedef struct USBDescMSOS USBDescMSOS;
>
> -struct USBDescString {
> - uint8_t index;
> - char *str;
> - QLIST_ENTRY(USBDescString) next;
> -};
> -
> #define USB_MAX_ENDPOINTS 15
> #define USB_MAX_INTERFACES 16
>
> @@ -555,10 +549,6 @@ int usb_device_alloc_streams(USBDevice *dev, USBEndpoint
> **eps, int nr_eps,
> int streams);
> void usb_device_free_streams(USBDevice *dev, USBEndpoint **eps, int nr_eps);
>
> -const char *usb_device_get_product_desc(USBDevice *dev);
> -
> -const USBDesc *usb_device_get_usb_desc(USBDevice *dev);
> -
> /* quirks.c */
>
> /* In bulk endpoints are streaming data sources (iow behave like isoc eps) */
> diff --git a/hw/usb/bus.c b/hw/usb/bus.c
> index 957559b18d..111c3af7c1 100644
> --- a/hw/usb/bus.c
> +++ b/hw/usb/bus.c
> @@ -9,6 +9,7 @@
> #include "monitor/monitor.h"
> #include "trace.h"
> #include "qemu/cutils.h"
> +#include "desc.h"
>
> static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent);
>
> --
> 2.21.3
>
>
- Re: [PATCH 09/26] hw/usb/hcd-ehci: Remove unnecessary include, (continued)
- [PATCH 10/26] hw/usb/hcd-ehci: Move few definitions from header to source, Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 11/26] hw/usb/hcd-xhci: Add missing header, Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 12/26] hw/usb/hcd-musb: Restrict header scope, Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 14/26] hw/usb/quirks: Rename included source with '.inc.c' suffix, Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 13/26] hw/usb/desc: Reduce some declarations scope, Philippe Mathieu-Daudé, 2020/07/04
- Re: [PATCH 13/26] hw/usb/desc: Reduce some declarations scope,
Alistair Francis <=
- [PATCH 15/26] hw/usb: Add new 'usb-quirks.h' local header, Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 16/26] hw/usb/bus: Simplify usb_get_dev_path(), Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 19/26] hw/ppc/spapr: Use usb_get_port_path(), Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 17/26] hw/usb/bus: Rename usb_get_dev_path() as usb_get_full_dev_path(), Philippe Mathieu-Daudé, 2020/07/04
- [PATCH 18/26] hw/usb/bus: Add usb_get_port_path(), Philippe Mathieu-Daudé, 2020/07/04