From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Wed, 1 Aug 2012 18:45:34 -0400 Subject: [U-Boot] [PATCH v3 2/7] dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget In-Reply-To: <1343716623-8943-3-git-send-email-l.majewski@samsung.com> References: <1341308291-14663-1-git-send-email-l.majewski@samsung.com> <1343716623-8943-1-git-send-email-l.majewski@samsung.com> <1343716623-8943-3-git-send-email-l.majewski@samsung.com> Message-ID: <201208011845.37239.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday 31 July 2012 02:36:58 Lukasz Majewski wrote: > --- /dev/null > +++ b/drivers/usb/gadget/f_dfu.c > > +static struct usb_interface_descriptor dfu_intf_runtime = { can this be made const ? > +static struct usb_descriptor_header *dfu_runtime_descs[] = { > + (struct usb_descriptor_header *) &dfu_intf_runtime, can you change the descs array to be const ? static const struct usb_descriptor_header * const dfu_runtime_descs[] = { then i think you can drop the cast there ... > +static struct usb_qualifier_descriptor dev_qualifier = { > +static struct usb_gadget_strings stringtab_dfu_generic = { > +static struct usb_gadget_strings *dfu_generic_strings[] = { > +static struct usb_gadget_strings stringtab_dfu = { > +static struct usb_gadget_strings *dfu_strings[] = { can these be made const ? > +static void handle_getstate(struct usb_request *req) > +{ > + struct f_dfu *f_dfu = req->context; > + > + ((u8 *)req->buf)[0] = f_dfu->dfu_state & 0xff; pretty sure you don't need that "& 0xff" > +static int state_app_idle(struct f_dfu *f_dfu, > + const struct usb_ctrlrequest *ctrl, > + struct usb_gadget *gadget, > + struct usb_request *req) > +{ > + int value = 0; might be good to push this down into the 1 case statement (USB_REQ_DFU_GETSTATE) that uses it rather than init it up top same goes for all the other funcs below that follow this style -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: