Skip to content

Commit

Permalink
USB: Standardize inclusion protection and add where missing.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert P. J. Day authored and Greg Kroah-Hartman committed Apr 25, 2008
1 parent f66396b commit dda43a0
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 40 deletions.
2 changes: 1 addition & 1 deletion include/linux/usb/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ struct usb_ac_header_descriptor_##n { \
__u8 baInterfaceNr[n]; \
} __attribute__ ((packed))

#endif
#endif /* __LINUX_USB_AUDIO_H */
4 changes: 4 additions & 0 deletions include/linux/usb/cdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -221,3 +224,4 @@ struct usb_cdc_notification {
__le16 wLength;
} __attribute__ ((packed));

#endif /* __LINUX_USB_CDC_H */
2 changes: 1 addition & 1 deletion include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,4 +586,4 @@ enum usb_device_state {
*/
};

#endif /* __LINUX_USB_CH9_H */
#endif /* __LINUX_USB_CH9_H */
4 changes: 4 additions & 0 deletions include/linux/usb/g_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */
2 changes: 1 addition & 1 deletion include/linux/usb/gadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
16 changes: 8 additions & 8 deletions include/linux/usb/gadgetfs.h
Original file line number Diff line number Diff line change
@@ -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
*
Expand All @@ -23,6 +15,14 @@
* 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
Expand Down
8 changes: 4 additions & 4 deletions include/linux/usb/input.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef __USB_INPUT_H
#define __USB_INPUT_H

/*
* Copyright (C) 2005 Dmitry Torokhov
*
Expand All @@ -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>
Expand All @@ -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 */
6 changes: 3 additions & 3 deletions include/linux/usb/iowarrior.h
Original file line number Diff line number Diff line change
@@ -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 */

Expand Down Expand Up @@ -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 */
6 changes: 5 additions & 1 deletion include/linux/usb/isp116x.h
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -27,3 +29,5 @@ struct isp116x_platform_data {
*/
void (*delay) (struct device *dev, int delay);
};

#endif /* __LINUX_USB_ISP116X_H */
2 changes: 1 addition & 1 deletion include/linux/usb/midi.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ struct usb_ms_endpoint_descriptor_##n { \
__u8 baAssocJackID[n]; \
} __attribute__ ((packed))

#endif
#endif /* __LINUX_USB_MIDI_H */
9 changes: 4 additions & 5 deletions include/linux/usb/net2280.h
Original file line number Diff line number Diff line change
@@ -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
*
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion include/linux/usb/otg.h
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 */
5 changes: 5 additions & 0 deletions include/linux/usb/quirks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -12,3 +15,5 @@

/* device can't handle Set-Interface requests */
#define USB_QUIRK_NO_SET_INTF 0x00000004

#endif /* __LINUX_USB_QUIRKS_H */
9 changes: 3 additions & 6 deletions include/linux/usb/rndis_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
* 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.
Expand Down Expand Up @@ -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 */
3 changes: 1 addition & 2 deletions include/linux/usb/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
*/


#ifndef __LINUX_USB_SERIAL_H
#define __LINUX_USB_SERIAL_H

Expand Down Expand Up @@ -340,5 +339,5 @@ static inline void usb_serial_debug_data(int debug,



#endif /* ifdef __LINUX_USB_SERIAL_H */
#endif /* __LINUX_USB_SERIAL_H */

5 changes: 4 additions & 1 deletion include/linux/usb/sl811.h
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -24,3 +26,4 @@ struct sl811_platform_data {
/* void (*clock_enable)(struct device *dev, int is_on); */
};

#endif /* __LINUX_USB_SL811_H */
8 changes: 3 additions & 5 deletions include/linux/usb/usbnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
* 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 {
Expand Down Expand Up @@ -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 */

0 comments on commit dda43a0

Please sign in to comment.