[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150916.105454.1537994485794572085.davem@davemloft.net>
Date: Wed, 16 Sep 2015 10:54:54 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: fengguang.wu@...el.com
Cc: oneukum@...e.com, kbuild-all@...org, netdev@...r.kernel.org
Subject: Re: [net-next:master 6/12] include/linux/usb/cdc.h:23: error:
redefinition of 'struct usb_cdc_parsed_header'
From: Fengguang Wu <fengguang.wu@...el.com>
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 <fengguang.wu@...el.com>
>> 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 <linux/usb/cdc.h> 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 <sfr@...b.auug.org.au>
Date: Wed Sep 16 11:10:16 2015 +1000
cdc: add header guards
Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: David S. Miller <davem@...emloft.net>
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 <uapi/linux/usb/cdc.h>
@@ -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 <linux/types.h>
@@ -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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists