Re: [net-next:master 6/12] include/linux/usb/cdc.h:23: error: redefinition of 'struct usb_cdc_parsed_header'
On Tue, Sep 15, 2015 at 01:27:42PM -0700, David Miller wrote: > From: kbuild test robot> Date: Wed, 16 Sep 2015 03:57:11 +0800 > > > All error/warnings (new ones prefixed by >>): > > > >In file included from drivers/usb/gadget/function/u_ether.h:20, > > from drivers/usb/gadget/legacy/cdc2.c:16: > >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared > > inside parameter list > >include/linux/usb/cdc.h:47: warning: its scope is only this definition > > or declaration, which is probably not what you want > >In file included from drivers/usb/gadget/function/u_serial.h:16, > > from drivers/usb/gadget/legacy/cdc2.c:17: > >>> include/linux/usb/cdc.h:23: error: redefinition of 'struct > >>> usb_cdc_parsed_header' > >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared > > inside parameter list > >>> include/linux/usb/cdc.h:47: error: conflicting types for > >>> 'cdc_parse_cdc_header' > >include/linux/usb/cdc.h:47: error: previous declaration of > > 'cdc_parse_cdc_header' was here > > This may be a side effect of the initial warning, does this reproduce with > that fixed? Please show me what the warning looks like in that case. Dave, net-next/master commit ad1e7b97b3 ("cdc: Fix build warning.") still has errors. The problem is, the header file is included twice. recent_errors ├── arm-arm5 │ ├── include-linux-usb-cdc.h:error:conflicting-types-for-cdc_parse_cdc_header │ └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header ├── arm-arm67 │ ├── include-linux-usb-cdc.h:error:conflicting-types-for-cdc_parse_cdc_header │ └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header ├── arm-mmp │ ├── include-linux-usb-cdc.h:error:conflicting-types-for-cdc_parse_cdc_header │ └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header ├── arm-omap2plus_defconfig │ ├── include-linux-usb-cdc.h:error:conflicting-types-for-cdc_parse_cdc_header │ └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header ├── avr32-atngw100_defconfig │ └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header ├── avr32-atstk1006_defconfig │ └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header └── i386-allmodconfig ├── include-linux-usb-cdc.h:error:conflicting-types-for-cdc_parse_cdc_header └── include-linux-usb-cdc.h:error:redefinition-of-struct-usb_cdc_parsed_header The error messages are now: In file included from drivers/usb/gadget/function/u_ether.h:20:0, from drivers/usb/gadget/function/f_ncm.c:26: include/linux/usb/cdc.h:23:8: error: redefinition of 'struct usb_cdc_parsed_header' struct usb_cdc_parsed_header { ^ In file included from drivers/usb/gadget/function/f_ncm.c:24:0: include/linux/usb/cdc.h:23:8: note: originally defined here struct usb_cdc_parsed_header { ^ In file included from drivers/usb/gadget/function/u_ether.h:20:0, from drivers/usb/gadget/function/f_ncm.c:26: include/linux/usb/cdc.h:44:5: error: conflicting types for 'cdc_parse_cdc_header' int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, ^ In file included from drivers/usb/gadget/function/f_ncm.c:24:0: include/linux/usb/cdc.h:44:5: note: previous declaration of 'cdc_parse_cdc_header' was here int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, ^ Thanks, Fengguang -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [net-next:master 6/12] include/linux/usb/cdc.h:23: error: redefinition of 'struct usb_cdc_parsed_header'
From: Fengguang WuDate: Wed, 16 Sep 2015 21:06:58 +0800 > On Tue, Sep 15, 2015 at 01:27:42PM -0700, David Miller wrote: >> From: kbuild test robot >> Date: Wed, 16 Sep 2015 03:57:11 +0800 >> >> > All error/warnings (new ones prefixed by >>): >> > >> >In file included from drivers/usb/gadget/function/u_ether.h:20, >> > from drivers/usb/gadget/legacy/cdc2.c:16: >> >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared >> > inside parameter list >> >include/linux/usb/cdc.h:47: warning: its scope is only this definition >> > or declaration, which is probably not what you want >> >In file included from drivers/usb/gadget/function/u_serial.h:16, >> > from drivers/usb/gadget/legacy/cdc2.c:17: >> >>> include/linux/usb/cdc.h:23: error: redefinition of 'struct >> >>> usb_cdc_parsed_header' >> >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared >> > inside parameter list >> >>> include/linux/usb/cdc.h:47: error: conflicting types for >> >>> 'cdc_parse_cdc_header' >> >include/linux/usb/cdc.h:47: error: previous declaration of >> > 'cdc_parse_cdc_header' was here >> >> This may be a side effect of the initial warning, does this reproduce with >> that fixed? Please show me what the warning looks like in that case. > > Dave, net-next/master commit ad1e7b97b3 ("cdc: Fix build warning.") > still has errors. > > The problem is, the header file is included twice. That's not possible after the patch I committed from Stephen Rothwell which adds proper include guards: commit b84ee0d7f375ed7840c7c110d46eac24cf94b2a2 Author: Stephen Rothwell Date: Wed Sep 16 11:10:16 2015 +1000 cdc: add header guards Signed-off-by: Stephen Rothwell Signed-off-by: David S. Miller diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index 959d0c8..b5706f9 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h @@ -7,6 +7,8 @@ * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. */ +#ifndef __LINUX_USB_CDC_H +#define __LINUX_USB_CDC_H #include @@ -45,3 +47,5 @@ int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, struct usb_interface *intf, u8 *buffer, int buflen); + +#endif /* __LINUX_USB_CDC_H */ diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h index b6a9cdd..e2bc417 100644 --- a/include/uapi/linux/usb/cdc.h +++ b/include/uapi/linux/usb/cdc.h @@ -6,8 +6,8 @@ * firmware based USB peripherals. */ -#ifndef __LINUX_USB_CDC_H -#define __LINUX_USB_CDC_H +#ifndef __UAPI_LINUX_USB_CDC_H +#define __UAPI_LINUX_USB_CDC_H #include @@ -444,4 +444,4 @@ struct usb_cdc_ncm_ndp_input_size { #define USB_CDC_NCM_CRC_NOT_APPENDED 0x00 #define USB_CDC_NCM_CRC_APPENDED 0x01 -#endif /* __LINUX_USB_CDC_H */ +#endif /* __UAPI_LINUX_USB_CDC_H */ -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [net-next:master 6/12] include/linux/usb/cdc.h:23: error: redefinition of 'struct usb_cdc_parsed_header'
On Wed, Sep 16, 2015 at 10:54:54AM -0700, David Miller wrote: > From: Fengguang Wu> Date: Wed, 16 Sep 2015 21:06:58 +0800 > > > On Tue, Sep 15, 2015 at 01:27:42PM -0700, David Miller wrote: > >> From: kbuild test robot > >> Date: Wed, 16 Sep 2015 03:57:11 +0800 > >> > >> > All error/warnings (new ones prefixed by >>): > >> > > >> >In file included from drivers/usb/gadget/function/u_ether.h:20, > >> > from drivers/usb/gadget/legacy/cdc2.c:16: > >> >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared > >> > inside parameter list > >> >include/linux/usb/cdc.h:47: warning: its scope is only this > >> > definition or declaration, which is probably not what you want > >> >In file included from drivers/usb/gadget/function/u_serial.h:16, > >> > from drivers/usb/gadget/legacy/cdc2.c:17: > >> >>> include/linux/usb/cdc.h:23: error: redefinition of 'struct > >> >>> usb_cdc_parsed_header' > >> >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared > >> > inside parameter list > >> >>> include/linux/usb/cdc.h:47: error: conflicting types for > >> >>> 'cdc_parse_cdc_header' > >> >include/linux/usb/cdc.h:47: error: previous declaration of > >> > 'cdc_parse_cdc_header' was here > >> > >> This may be a side effect of the initial warning, does this reproduce with > >> that fixed? Please show me what the warning looks like in that case. > > > > Dave, net-next/master commit ad1e7b97b3 ("cdc: Fix build warning.") > > still has errors. > > > > The problem is, the header file is included twice. > > That's not possible after the patch I committed from Stephen Rothwell > which adds proper include guards: Yes, this patch fixed the errors nicely! Thanks, Fengguang > > commit b84ee0d7f375ed7840c7c110d46eac24cf94b2a2 > Author: Stephen Rothwell > Date: Wed Sep 16 11:10:16 2015 +1000 > > cdc: add header guards > > Signed-off-by: Stephen Rothwell > Signed-off-by: David S. Miller > > diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h > index 959d0c8..b5706f9 100644 > --- a/include/linux/usb/cdc.h > +++ b/include/linux/usb/cdc.h > @@ -7,6 +7,8 @@ > * modify it under the terms of the GNU General Public License > * version 2 as published by the Free Software Foundation. > */ > +#ifndef __LINUX_USB_CDC_H > +#define __LINUX_USB_CDC_H > > #include > > @@ -45,3 +47,5 @@ int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, > struct usb_interface *intf, > u8 *buffer, > int buflen); > + > +#endif /* __LINUX_USB_CDC_H */ > diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h > index b6a9cdd..e2bc417 100644 > --- a/include/uapi/linux/usb/cdc.h > +++ b/include/uapi/linux/usb/cdc.h > @@ -6,8 +6,8 @@ > * firmware based USB peripherals. > */ > > -#ifndef __LINUX_USB_CDC_H > -#define __LINUX_USB_CDC_H > +#ifndef __UAPI_LINUX_USB_CDC_H > +#define __UAPI_LINUX_USB_CDC_H > > #include > > @@ -444,4 +444,4 @@ struct usb_cdc_ncm_ndp_input_size { > #define USB_CDC_NCM_CRC_NOT_APPENDED 0x00 > #define USB_CDC_NCM_CRC_APPENDED 0x01 > > -#endif /* __LINUX_USB_CDC_H */ > +#endif /* __UAPI_LINUX_USB_CDC_H */ -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [net-next:master 6/12] include/linux/usb/cdc.h:23: error: redefinition of 'struct usb_cdc_parsed_header'
From: kbuild test robotDate: Wed, 16 Sep 2015 03:57:11 +0800 > All error/warnings (new ones prefixed by >>): > >In file included from drivers/usb/gadget/function/u_ether.h:20, > from drivers/usb/gadget/legacy/cdc2.c:16: >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared > inside parameter list >include/linux/usb/cdc.h:47: warning: its scope is only this definition or > declaration, which is probably not what you want >In file included from drivers/usb/gadget/function/u_serial.h:16, > from drivers/usb/gadget/legacy/cdc2.c:17: >>> include/linux/usb/cdc.h:23: error: redefinition of 'struct >>> usb_cdc_parsed_header' >include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared > inside parameter list >>> include/linux/usb/cdc.h:47: error: conflicting types for >>> 'cdc_parse_cdc_header' >include/linux/usb/cdc.h:47: error: previous declaration of > 'cdc_parse_cdc_header' was here This may be a side effect of the initial warning, does this reproduce with that fixed? Please show me what the warning looks like in that case. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[net-next:master 6/12] include/linux/usb/cdc.h:23: error: redefinition of 'struct usb_cdc_parsed_header'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: 8b711d6db5c78a6d1969fb0fccb93daa7df53762 commit: c40a2c8817e42273a4627c48c884b805475a733f [6/12] CDC: common parser for extra headers config: avr32-atngw100_defconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout c40a2c8817e42273a4627c48c884b805475a733f # save the attached .config to linux build tree make.cross ARCH=avr32 All error/warnings (new ones prefixed by >>): In file included from drivers/usb/gadget/function/u_ether.h:20, from drivers/usb/gadget/legacy/cdc2.c:16: include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared inside parameter list include/linux/usb/cdc.h:47: warning: its scope is only this definition or declaration, which is probably not what you want In file included from drivers/usb/gadget/function/u_serial.h:16, from drivers/usb/gadget/legacy/cdc2.c:17: >> include/linux/usb/cdc.h:23: error: redefinition of 'struct >> usb_cdc_parsed_header' include/linux/usb/cdc.h:47: warning: 'struct usb_interface' declared inside parameter list >> include/linux/usb/cdc.h:47: error: conflicting types for >> 'cdc_parse_cdc_header' include/linux/usb/cdc.h:47: error: previous declaration of 'cdc_parse_cdc_header' was here vim +23 include/linux/usb/cdc.h 17 #define CDC_PHONET_MAGIC_NUMBER 0xAB 18 19 /* 20 * parsing CDC headers 21 */ 22 > 23 struct usb_cdc_parsed_header { 24 struct usb_cdc_union_desc *usb_cdc_union_desc; 25 struct usb_cdc_header_desc *usb_cdc_header_desc; 26 27 struct usb_cdc_call_mgmt_descriptor *usb_cdc_call_mgmt_descriptor; 28 struct usb_cdc_acm_descriptor *usb_cdc_acm_descriptor; 29 struct usb_cdc_country_functional_desc *usb_cdc_country_functional_desc; 30 struct usb_cdc_network_terminal_desc *usb_cdc_network_terminal_desc; 31 struct usb_cdc_ether_desc *usb_cdc_ether_desc; 32 struct usb_cdc_dmm_desc *usb_cdc_dmm_desc; 33 struct usb_cdc_mdlm_desc *usb_cdc_mdlm_desc; 34 struct usb_cdc_mdlm_detail_desc *usb_cdc_mdlm_detail_desc; 35 struct usb_cdc_obex_desc *usb_cdc_obex_desc; 36 struct usb_cdc_ncm_desc *usb_cdc_ncm_desc; 37 struct usb_cdc_mbim_desc *usb_cdc_mbim_desc; 38 struct usb_cdc_mbim_extended_desc *usb_cdc_mbim_extended_desc; 39 40 bool phonet_magic_present; 41 }; 42 43 44 int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, 45 struct usb_interface *intf, 46 u8 *buffer, > 47 int buflen); --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation # # Automatically generated file; DO NOT EDIT. # Linux/avr32 4.2.0 Kernel Configuration # CONFIG_AVR32=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_GENERIC_BUG=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y # # General setup # CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_CROSS_MEMORY_ATTACH=y # CONFIG_FHANDLE is not set CONFIG_USELIB=y # CONFIG_AUDIT is not set # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_GENERIC_CLOCKEVENTS=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # # RCU Subsystem # CONFIG_TINY_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set # CONFIG_RCU_STALL_COMMON is not set # CONFIG_TREE_RCU_TRACE is not set # CONFIG_RCU_EXPEDITE_BOOT is not set # CONFIG_BUILD_BIN2C is not set # CONFIG_IKCONFIG is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_CGROUPS is not set # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_NAMESPACES is not set # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y