From: Remy Bohmer Date: Mon, 12 Oct 2009 21:08:10 +0200 Subject: [U-Boot] [PATCH 1/8] USB Consolidate descriptor definitions In-Reply-To: <1254155849-22329-2-git-send-email-Tom.Rix@windriver.com> References: <1254155849-22329-1-git-send-email-Tom.Rix@windriver.com> <1254155849-22329-2-git-send-email-Tom.Rix@windriver.com> Message-ID: <3efb10970910121208x77a2c1b2obc7fdd4ae7ab142c@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, Sorry for not responding to this series very fast, because I wanted to look into it carefully. Below my comments on this patch 2009/9/28 Tom Rix : > The header files usb.h and usbdescriptors.h have the same or > similarly named structure definitions for > > usb_device_descriptor > usb_string_descriptor > usb_endpoint_descriptor > usb_config_descriptor vs usb_configuration_descriptor > usb_interface_descriptor > > There should only be one definition of these structures. True, I agree with that. > Some of these structures are element-wise duplicates, > one has unused elements that can be reduced to a duplicate, > and some of the the structures have additional elements. > > These are the element-wise duplicates in usb.h > > usb_device_descriptor > usb_string_descriptor > > For these, the usb.h definition will be removed. > > This definition in usb.h has extra unused elements Can these be merged to one global structure? > usb_endpoint_descriptor > > ? ? ? ?unsigned char ? bRefresh > ? ? ? ?unsigned char ? bSynchAddress; > > The definition of usb_endpoint_descriptor in usb.h will > be removed. > > These definitions in usb.h have extra elements at the end of > the usb 2.0 specified descriptor: > > usb_config_descriptor > usb_interface_descriptor > > These structures will have their name shorted by removing the > '_descriptor' suffix. > > So > > usb_config_descriptor -> usb_config > usb_interface_descriptor -> usb_interface > > The common descriptor elements are now defined by the macros > > USB_CONFIG_DESCRIPTOR_DEFINITION > USB_INTERFACE_DESCRIPTOR_DEFINITION Personally I do not like the macros for these kind of definitions, I would prefer a solution by nesting the structures. What do you think? Kind regards, Remy