USB: Standardize inclusion protection and add where missing.
authorRobert P. J. Day <rpjday@crashcourse.ca>
Fri, 7 Mar 2008 18:45:32 +0000 (13:45 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Apr 2008 04:16:42 +0000 (21:16 -0700)
For the header files in include/linux/usb, add missing multiple
inclusion protection and standardize what's already there.  The
apparent standards:

  * macro name of __LINUX_USB_headerfile_H
  * inclusion protection placed after leading comment block
  * macro name added as a comment on the final #endif
  * any obvious trivial whitespace cleanup associated with the above

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 files changed:
include/linux/usb/audio.h
include/linux/usb/cdc.h
include/linux/usb/ch9.h
include/linux/usb/g_printer.h
include/linux/usb/gadget.h
include/linux/usb/gadgetfs.h
include/linux/usb/input.h
include/linux/usb/iowarrior.h
include/linux/usb/isp116x.h
include/linux/usb/midi.h
include/linux/usb/net2280.h
include/linux/usb/otg.h
include/linux/usb/quirks.h
include/linux/usb/rndis_host.h
include/linux/usb/serial.h
include/linux/usb/sl811.h
include/linux/usb/usbnet.h

index 2dfeef1..8cb025f 100644 (file)
@@ -50,4 +50,4 @@ struct usb_ac_header_descriptor_##n {                         \
        __u8  baInterfaceNr[n];                                 \
 } __attribute__ ((packed))
 
-#endif
+#endif /* __LINUX_USB_AUDIO_H */
index 94ee4ec..71e52f2 100644 (file)
@@ -6,6 +6,9 @@
  * firmware based USB peripherals.
  */
 
+#ifndef __LINUX_USB_CDC_H
+#define __LINUX_USB_CDC_H
+
 #define USB_CDC_SUBCLASS_ACM                   0x02
 #define USB_CDC_SUBCLASS_ETHERNET              0x06
 #define USB_CDC_SUBCLASS_WHCM                  0x08
@@ -221,3 +224,4 @@ struct usb_cdc_notification {
        __le16  wLength;
 } __attribute__ ((packed));
 
+#endif /* __LINUX_USB_CDC_H */
index 61fcbc2..7e0d308 100644 (file)
@@ -586,4 +586,4 @@ enum usb_device_state {
         */
 };
 
-#endif /* __LINUX_USB_CH9_H */
+#endif /* __LINUX_USB_CH9_H */
index 0c5ea1e..6178fde 100644 (file)
@@ -18,6 +18,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#ifndef __LINUX_USB_G_PRINTER_H
+#define __LINUX_USB_G_PRINTER_H
 
 #define PRINTER_NOT_ERROR      0x08
 #define PRINTER_SELECTED       0x10
@@ -29,3 +31,5 @@
  */
 #define GADGET_GET_PRINTER_STATUS      _IOR('g', 0x21, unsigned char)
 #define GADGET_SET_PRINTER_STATUS      _IOWR('g', 0x22, unsigned char)
+
+#endif /* __LINUX_USB_G_PRINTER_H */
index f329529..d8128f7 100644 (file)
@@ -846,4 +846,4 @@ extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,
 
 extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit;
 
-#endif /* __LINUX_USB_GADGET_H */
+#endif /* __LINUX_USB_GADGET_H */
index c291ab1..ea45f26 100644 (file)
@@ -1,11 +1,3 @@
-#ifndef __LINUX_USB_GADGETFS_H
-#define __LINUX_USB_GADGETFS_H
-
-#include <asm/types.h>
-#include <asm/ioctl.h>
-
-#include <linux/usb/ch9.h>
-
 /*
  * Filesystem based user-mode API to USB Gadget controller hardware
  *
  * then performing data transfers by reading or writing.
  */
 
+#ifndef __LINUX_USB_GADGETFS_H
+#define __LINUX_USB_GADGETFS_H
+
+#include <asm/types.h>
+#include <asm/ioctl.h>
+
+#include <linux/usb/ch9.h>
+
 /*
  * Events are delivered on the ep0 file descriptor, when the user mode driver
  * reads from this file descriptor after writing the descriptors.  Don't
index 716e0cc..0e010b2 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef __USB_INPUT_H
-#define __USB_INPUT_H
-
 /*
  * Copyright (C) 2005 Dmitry Torokhov
  *
@@ -9,6 +6,9 @@
  * the Free Software Foundation.
  */
 
+#ifndef __LINUX_USB_INPUT_H
+#define __LINUX_USB_INPUT_H
+
 #include <linux/usb.h>
 #include <linux/input.h>
 #include <asm/byteorder.h>
@@ -22,4 +22,4 @@ usb_to_input_id(const struct usb_device *dev, struct input_id *id)
        id->version = le16_to_cpu(dev->descriptor.bcdDevice);
 }
 
-#endif
+#endif /* __LINUX_USB_INPUT_H */
index de6f380..4fd6513 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _IOWARRIOR_H_
-#define _IOWARRIOR_H_
+#ifndef __LINUX_USB_IOWARRIOR_H
+#define __LINUX_USB_IOWARRIOR_H
 
 #define CODEMERCS_MAGIC_NUMBER 0xC0    /* like COde Mercenaries */
 
@@ -39,4 +39,4 @@ struct iowarrior_info {
 */
 #define IOW_GETINFO _IOR(CODEMERCS_MAGIC_NUMBER, 3, struct iowarrior_info)
 
-#endif  /* _IOWARRIOR_H_ */
+#endif /* __LINUX_USB_IOWARRIOR_H */
index 67d2826..96ca114 100644 (file)
@@ -1,9 +1,11 @@
-
 /*
  * Board initialization code should put one of these into dev->platform_data
  * and place the isp116x onto platform_bus.
  */
 
+#ifndef __LINUX_USB_ISP116X_H
+#define __LINUX_USB_ISP116X_H
+
 struct isp116x_platform_data {
        /* Enable internal resistors on downstream ports */
        unsigned sel15Kres:1;
@@ -27,3 +29,5 @@ struct isp116x_platform_data {
         */
        void (*delay) (struct device *dev, int delay);
 };
+
+#endif /* __LINUX_USB_ISP116X_H */
index 80624c5..1d10408 100644 (file)
@@ -109,4 +109,4 @@ struct usb_ms_endpoint_descriptor_##n {                             \
        __u8  baAssocJackID[n];                                 \
 } __attribute__ ((packed))
 
-#endif
+#endif /* __LINUX_USB_MIDI_H */
index ec897cb..96ca549 100644 (file)
@@ -1,11 +1,7 @@
 /*
  * NetChip 2280 high/full speed USB device controller.
  * Unlike many such controllers, this one talks PCI.
- */
-#ifndef __LINUX_USB_NET2280_H
-#define __LINUX_USB_NET2280_H
-
-/*
+ *
  * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com)
  * Copyright (C) 2003 David Brownell
  *
@@ -24,6 +20,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#ifndef __LINUX_USB_NET2280_H
+#define __LINUX_USB_NET2280_H
+
 /*-------------------------------------------------------------------------*/
 
 /* NET2280 MEMORY MAPPED REGISTERS
index e007074..1db25d1 100644 (file)
@@ -1,11 +1,13 @@
 /* USB OTG (On The Go) defines */
-
 /*
+ *
  * These APIs may be used between USB controllers.  USB device drivers
  * (for either host or peripheral roles) don't use these calls; they
  * continue to use just usb_device and usb_gadget.
  */
 
+#ifndef __LINUX_USB_OTG_H
+#define __LINUX_USB_OTG_H
 
 /* OTG defines lots of enumeration states before device reset */
 enum usb_otg_state {
@@ -129,3 +131,5 @@ otg_start_srp(struct otg_transceiver *otg)
 
 /* for OTG controller drivers (and maybe other stuff) */
 extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
+
+#endif /* __LINUX_USB_OTG_H */
index 1f999ec..7f6c603 100644 (file)
@@ -4,6 +4,9 @@
  * belong here.
  */
 
+#ifndef __LINUX_USB_QUIRKS_H
+#define __LINUX_USB_QUIRKS_H
+
 /* string descriptors must not be fetched using a 255-byte read */
 #define USB_QUIRK_STRING_FETCH_255     0x00000001
 
@@ -12,3 +15,5 @@
 
 /* device can't handle Set-Interface requests */
 #define USB_QUIRK_NO_SET_INTF          0x00000004
+
+#endif /* __LINUX_USB_QUIRKS_H */
index edc1d4a..29d6458 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-
-#ifndef        __RNDIS_HOST_H
-#define        __RNDIS_HOST_H
-
+#ifndef        __LINUX_USB_RNDIS_HOST_H
+#define        __LINUX_USB_RNDIS_HOST_H
 
 /*
  * CONTROL uses CDC "encapsulated commands" with funky notifications.
@@ -270,5 +268,4 @@ extern int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb);
 extern struct sk_buff *
 rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags);
 
-#endif /* __RNDIS_HOST_H */
-
+#endif /* __LINUX_USB_RNDIS_HOST_H */
index 21b4a1c..f1b7434 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-
 #ifndef __LINUX_USB_SERIAL_H
 #define __LINUX_USB_SERIAL_H
 
@@ -340,5 +339,5 @@ static inline void usb_serial_debug_data(int debug,
 
 
 
-#endif /* ifdef __LINUX_USB_SERIAL_H */
+#endif /* __LINUX_USB_SERIAL_H */
 
index 877373d..3afe4d1 100644 (file)
@@ -1,9 +1,11 @@
-
 /*
  * board initialization should put one of these into dev->platform_data
  * and place the sl811hs onto platform_bus named "sl811-hcd".
  */
 
+#ifndef __LINUX_USB_SL811_H
+#define __LINUX_USB_SL811_H
+
 struct sl811_platform_data {
        unsigned        can_wakeup:1;
 
@@ -24,3 +26,4 @@ struct sl811_platform_data {
        /* void         (*clock_enable)(struct device *dev, int is_on); */
 };
 
+#endif /* __LINUX_USB_SL811_H */
index e0501da..ba09fe8 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-
-#ifndef        __USBNET_H
-#define        __USBNET_H
-
+#ifndef        __LINUX_USB_USBNET_H
+#define        __LINUX_USB_USBNET_H
 
 /* interface from usbnet core to each USB networking link we handle */
 struct usbnet {
@@ -211,4 +209,4 @@ extern int usbnet_nway_reset(struct net_device *net);
        printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \
 
 
-#endif /* __USBNET_H */
+#endif /* __LINUX_USB_USBNET_H */