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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot