kernel_optimize_test/drivers/usb/gadget
Jesper Juhl a283c03a3a USB, Mass Storage, composite, gadget: Fix build failure and memset of a struct
Trying to compile drivers/usb/gadget/f_mass_storage.o currently fails and
spews a ton of warnings :

  CC      drivers/usb/gadget/f_mass_storage.o
drivers/usb/gadget/f_mass_storage.c:436:22: error: field ‘function’ has incomplete type
drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_from_func’:
drivers/usb/gadget/f_mass_storage.c:466:9: warning: type defaults to ‘int’ in declaration of ‘__mptr’
drivers/usb/gadget/f_mass_storage.c:466:9: warning: initialization from incompatible pointer type
drivers/usb/gadget/f_mass_storage.c: At top level:
drivers/usb/gadget/f_mass_storage.c:2743:15: warning: ‘struct usb_composite_dev’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c:2743:15: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_common_init’:
drivers/usb/gadget/f_mass_storage.c:2745:34: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:2775:23: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:2779:3: error: implicit declaration of function ‘usb_string_id’
drivers/usb/gadget/f_mass_storage.c: At top level:
drivers/usb/gadget/f_mass_storage.c:2984:60: warning: ‘struct usb_configuration’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c:3003:57: warning: ‘struct usb_configuration’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_bind’:
drivers/usb/gadget/f_mass_storage.c:3006:31: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:3013:2: error: implicit declaration of function ‘usb_interface_id’
drivers/usb/gadget/f_mass_storage.c:3033:3: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:3034:6: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:3043:4: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:3044:7: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c:3045:26: error: dereferencing pointer to incomplete type
drivers/usb/gadget/f_mass_storage.c: At top level:
drivers/usb/gadget/f_mass_storage.c:3067:14: warning: ‘struct usb_configuration’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c:3067:14: warning: ‘struct usb_composite_dev’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_bind_config’:
drivers/usb/gadget/f_mass_storage.c:3093:2: error: implicit declaration of function ‘usb_add_function’
drivers/usb/gadget/f_mass_storage.c: At top level:
drivers/usb/gadget/f_mass_storage.c:3103:9: warning: ‘struct usb_configuration’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c:3103:9: warning: ‘struct usb_composite_dev’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_add’:
drivers/usb/gadget/f_mass_storage.c:3105:2: warning: passing argument 1 of ‘fsg_bind_config’ from incompatible pointer type
drivers/usb/gadget/f_mass_storage.c:3065:12: note: expected ‘struct usb_composite_dev *’ but argument is of type ‘struct usb_composite_dev *’
drivers/usb/gadget/f_mass_storage.c:3105:2: warning: passing argument 2 of ‘fsg_bind_config’ from incompatible pointer type
drivers/usb/gadget/f_mass_storage.c:3065:12: note: expected ‘struct usb_configuration *’ but argument is of type ‘struct usb_configuration *’
drivers/usb/gadget/f_mass_storage.c: At top level:
drivers/usb/gadget/f_mass_storage.c:3190:23: warning: ‘struct usb_composite_dev’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c:3195:23: warning: ‘struct usb_composite_dev’ declared inside parameter list
drivers/usb/gadget/f_mass_storage.c:3193:1: error: conflicting types for ‘fsg_common_from_params’
drivers/usb/gadget/f_mass_storage.c:3188:1: note: previous declaration of ‘fsg_common_from_params’ was here
drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_common_from_params’:
drivers/usb/gadget/f_mass_storage.c:3199:2: warning: passing argument 2 of ‘fsg_common_init’ from incompatible pointer type
drivers/usb/gadget/f_mass_storage.c:2741:27: note: expected ‘struct usb_composite_dev *’ but argument is of type ‘struct usb_composite_dev *’
make[1]: *** [drivers/usb/gadget/f_mass_storage.o] Error 1
make: *** [drivers/usb/gadget/f_mass_storage.o] Error 2

This is due to the missing include of linux/usb/composite.h - this patch
adds the missing include.

In addition there's also a problem in fsg_common_init() where we memset
'common', but we use the size of a pointer to 'struct fsg_common' as the
size argument to memset(), not the actual size of the struct. This patch
fixes the sizeof so we zero the entire struct as intended.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 12:38:14 -08:00
..
amd5536udc.c
amd5536udc.h
at91_udc.c
at91_udc.h
atmel_usba_udc.c
atmel_usba_udc.h
audio.c
cdc2.c
ci13xxx_msm.c
ci13xxx_pci.c
ci13xxx_udc.c USB: gadget: Fix endpoint representation in ci13xxx_udc 2011-01-22 18:49:24 -08:00
ci13xxx_udc.h USB: gadget: Fix endpoint representation in ci13xxx_udc 2011-01-22 18:49:24 -08:00
composite.c usb: gadget: composite: avoid access beyond array max length 2011-01-22 18:53:27 -08:00
config.c
dbgp.c
dummy_hcd.c
epautoconf.c
ether.c
f_acm.c
f_audio.c
f_ecm.c
f_eem.c
f_fs.c
f_hid.c
f_loopback.c
f_mass_storage.c USB, Mass Storage, composite, gadget: Fix build failure and memset of a struct 2011-02-04 12:38:14 -08:00
f_ncm.c
f_obex.c
f_phonet.c
f_rndis.c
f_serial.c
f_sourcesink.c
f_subset.c
f_uvc.c
f_uvc.h
file_storage.c
fsl_mxc_udc.c
fsl_qe_udc.c
fsl_qe_udc.h
fsl_udc_core.c
fsl_usb2_udc.h
g_ffs.c
g_zero.h
gadget_chips.h
gmidi.c
goku_udc.c
goku_udc.h
hid.c
imx_udc.c
imx_udc.h
inode.c
Kconfig USB: Fix trout build failure with ci13xxx_msm gadget 2011-02-04 12:38:14 -08:00
langwell_udc.c
langwell_udc.h
lh7a40x_udc.c
lh7a40x_udc.h
m66592-udc.c
m66592-udc.h
Makefile
mass_storage.c
multi.c
mv_udc_core.c
mv_udc_phy.c
mv_udc.h
ncm.c
ndis.h
net2280.c
net2280.h
nokia.c
omap_udc.c
omap_udc.h
pch_udc.c usb: pch_udc: Fix the worning log issue at gadget driver remove 2011-01-22 18:48:11 -08:00
printer.c USB: g_printer: fix bug in module parameter definitions 2011-01-22 18:38:58 -08:00
pxa25x_udc.c
pxa25x_udc.h
pxa27x_udc.c
pxa27x_udc.h
r8a66597-udc.c usb: r8a66597-udc: Fixed bufnum of Bulk 2011-02-03 16:45:50 -08:00
r8a66597-udc.h
rndis.c
rndis.h
s3c2410_udc.c
s3c2410_udc.h
s3c-hsotg.c
serial.c
storage_common.c
u_audio.c
u_audio.h
u_ether.c
u_ether.h
u_phonet.h
u_serial.c
u_serial.h
usbstring.c
uvc_queue.c
uvc_queue.h
uvc_v4l2.c
uvc_video.c
uvc.h
webcam.c
zero.c