Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: Standardize inclusion protection and add where missing.

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>

authored by

Robert P. J. Day and committed by
Greg Kroah-Hartman
dda43a0e f66396b5

+57 -40
+1 -1
include/linux/usb/audio.h
··· 50 50 __u8 baInterfaceNr[n]; \ 51 51 } __attribute__ ((packed)) 52 52 53 - #endif 53 + #endif /* __LINUX_USB_AUDIO_H */
+4
include/linux/usb/cdc.h
··· 6 6 * firmware based USB peripherals. 7 7 */ 8 8 9 + #ifndef __LINUX_USB_CDC_H 10 + #define __LINUX_USB_CDC_H 11 + 9 12 #define USB_CDC_SUBCLASS_ACM 0x02 10 13 #define USB_CDC_SUBCLASS_ETHERNET 0x06 11 14 #define USB_CDC_SUBCLASS_WHCM 0x08 ··· 224 221 __le16 wLength; 225 222 } __attribute__ ((packed)); 226 223 224 + #endif /* __LINUX_USB_CDC_H */
+1 -1
include/linux/usb/ch9.h
··· 586 586 */ 587 587 }; 588 588 589 - #endif /* __LINUX_USB_CH9_H */ 589 + #endif /* __LINUX_USB_CH9_H */
+4
include/linux/usb/g_printer.h
··· 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 21 + #ifndef __LINUX_USB_G_PRINTER_H 22 + #define __LINUX_USB_G_PRINTER_H 21 23 22 24 #define PRINTER_NOT_ERROR 0x08 23 25 #define PRINTER_SELECTED 0x10 ··· 31 29 */ 32 30 #define GADGET_GET_PRINTER_STATUS _IOR('g', 0x21, unsigned char) 33 31 #define GADGET_SET_PRINTER_STATUS _IOWR('g', 0x22, unsigned char) 32 + 33 + #endif /* __LINUX_USB_G_PRINTER_H */
+1 -1
include/linux/usb/gadget.h
··· 846 846 847 847 extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit; 848 848 849 - #endif /* __LINUX_USB_GADGET_H */ 849 + #endif /* __LINUX_USB_GADGET_H */
+8 -8
include/linux/usb/gadgetfs.h
··· 1 - #ifndef __LINUX_USB_GADGETFS_H 2 - #define __LINUX_USB_GADGETFS_H 3 - 4 - #include <asm/types.h> 5 - #include <asm/ioctl.h> 6 - 7 - #include <linux/usb/ch9.h> 8 - 9 1 /* 10 2 * Filesystem based user-mode API to USB Gadget controller hardware 11 3 * ··· 14 22 * or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT 15 23 * then performing data transfers by reading or writing. 16 24 */ 25 + 26 + #ifndef __LINUX_USB_GADGETFS_H 27 + #define __LINUX_USB_GADGETFS_H 28 + 29 + #include <asm/types.h> 30 + #include <asm/ioctl.h> 31 + 32 + #include <linux/usb/ch9.h> 17 33 18 34 /* 19 35 * Events are delivered on the ep0 file descriptor, when the user mode driver
+4 -4
include/linux/usb/input.h
··· 1 - #ifndef __USB_INPUT_H 2 - #define __USB_INPUT_H 3 - 4 1 /* 5 2 * Copyright (C) 2005 Dmitry Torokhov 6 3 * ··· 5 8 * under the terms of the GNU General Public License version 2 as published by 6 9 * the Free Software Foundation. 7 10 */ 11 + 12 + #ifndef __LINUX_USB_INPUT_H 13 + #define __LINUX_USB_INPUT_H 8 14 9 15 #include <linux/usb.h> 10 16 #include <linux/input.h> ··· 22 22 id->version = le16_to_cpu(dev->descriptor.bcdDevice); 23 23 } 24 24 25 - #endif 25 + #endif /* __LINUX_USB_INPUT_H */
+3 -3
include/linux/usb/iowarrior.h
··· 1 - #ifndef _IOWARRIOR_H_ 2 - #define _IOWARRIOR_H_ 1 + #ifndef __LINUX_USB_IOWARRIOR_H 2 + #define __LINUX_USB_IOWARRIOR_H 3 3 4 4 #define CODEMERCS_MAGIC_NUMBER 0xC0 /* like COde Mercenaries */ 5 5 ··· 39 39 */ 40 40 #define IOW_GETINFO _IOR(CODEMERCS_MAGIC_NUMBER, 3, struct iowarrior_info) 41 41 42 - #endif /* _IOWARRIOR_H_ */ 42 + #endif /* __LINUX_USB_IOWARRIOR_H */
+5 -1
include/linux/usb/isp116x.h
··· 1 - 2 1 /* 3 2 * Board initialization code should put one of these into dev->platform_data 4 3 * and place the isp116x onto platform_bus. 5 4 */ 5 + 6 + #ifndef __LINUX_USB_ISP116X_H 7 + #define __LINUX_USB_ISP116X_H 6 8 7 9 struct isp116x_platform_data { 8 10 /* Enable internal resistors on downstream ports */ ··· 29 27 */ 30 28 void (*delay) (struct device *dev, int delay); 31 29 }; 30 + 31 + #endif /* __LINUX_USB_ISP116X_H */
+1 -1
include/linux/usb/midi.h
··· 109 109 __u8 baAssocJackID[n]; \ 110 110 } __attribute__ ((packed)) 111 111 112 - #endif 112 + #endif /* __LINUX_USB_MIDI_H */
+4 -5
include/linux/usb/net2280.h
··· 1 1 /* 2 2 * NetChip 2280 high/full speed USB device controller. 3 3 * Unlike many such controllers, this one talks PCI. 4 - */ 5 - #ifndef __LINUX_USB_NET2280_H 6 - #define __LINUX_USB_NET2280_H 7 - 8 - /* 4 + * 9 5 * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) 10 6 * Copyright (C) 2003 David Brownell 11 7 * ··· 19 23 * along with this program; if not, write to the Free Software 20 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 25 */ 26 + 27 + #ifndef __LINUX_USB_NET2280_H 28 + #define __LINUX_USB_NET2280_H 22 29 23 30 /*-------------------------------------------------------------------------*/ 24 31
+5 -1
include/linux/usb/otg.h
··· 1 1 /* USB OTG (On The Go) defines */ 2 - 3 2 /* 3 + * 4 4 * These APIs may be used between USB controllers. USB device drivers 5 5 * (for either host or peripheral roles) don't use these calls; they 6 6 * continue to use just usb_device and usb_gadget. 7 7 */ 8 8 9 + #ifndef __LINUX_USB_OTG_H 10 + #define __LINUX_USB_OTG_H 9 11 10 12 /* OTG defines lots of enumeration states before device reset */ 11 13 enum usb_otg_state { ··· 131 129 132 130 /* for OTG controller drivers (and maybe other stuff) */ 133 131 extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); 132 + 133 + #endif /* __LINUX_USB_OTG_H */
+5
include/linux/usb/quirks.h
··· 4 4 * belong here. 5 5 */ 6 6 7 + #ifndef __LINUX_USB_QUIRKS_H 8 + #define __LINUX_USB_QUIRKS_H 9 + 7 10 /* string descriptors must not be fetched using a 255-byte read */ 8 11 #define USB_QUIRK_STRING_FETCH_255 0x00000001 9 12 ··· 15 12 16 13 /* device can't handle Set-Interface requests */ 17 14 #define USB_QUIRK_NO_SET_INTF 0x00000004 15 + 16 + #endif /* __LINUX_USB_QUIRKS_H */
+3 -6
include/linux/usb/rndis_host.h
··· 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 19 20 - 21 - #ifndef __RNDIS_HOST_H 22 - #define __RNDIS_HOST_H 23 - 20 + #ifndef __LINUX_USB_RNDIS_HOST_H 21 + #define __LINUX_USB_RNDIS_HOST_H 24 22 25 23 /* 26 24 * CONTROL uses CDC "encapsulated commands" with funky notifications. ··· 268 270 extern struct sk_buff * 269 271 rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); 270 272 271 - #endif /* __RNDIS_HOST_H */ 272 - 273 + #endif /* __LINUX_USB_RNDIS_HOST_H */
+1 -2
include/linux/usb/serial.h
··· 10 10 * 11 11 */ 12 12 13 - 14 13 #ifndef __LINUX_USB_SERIAL_H 15 14 #define __LINUX_USB_SERIAL_H 16 15 ··· 339 340 340 341 341 342 342 - #endif /* ifdef __LINUX_USB_SERIAL_H */ 343 + #endif /* __LINUX_USB_SERIAL_H */ 343 344
+4 -1
include/linux/usb/sl811.h
··· 1 - 2 1 /* 3 2 * board initialization should put one of these into dev->platform_data 4 3 * and place the sl811hs onto platform_bus named "sl811-hcd". 5 4 */ 5 + 6 + #ifndef __LINUX_USB_SL811_H 7 + #define __LINUX_USB_SL811_H 6 8 7 9 struct sl811_platform_data { 8 10 unsigned can_wakeup:1; ··· 26 24 /* void (*clock_enable)(struct device *dev, int is_on); */ 27 25 }; 28 26 27 + #endif /* __LINUX_USB_SL811_H */
+3 -5
include/linux/usb/usbnet.h
··· 19 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 */ 21 21 22 - 23 - #ifndef __USBNET_H 24 - #define __USBNET_H 25 - 22 + #ifndef __LINUX_USB_USBNET_H 23 + #define __LINUX_USB_USBNET_H 26 24 27 25 /* interface from usbnet core to each USB networking link we handle */ 28 26 struct usbnet { ··· 209 211 printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \ 210 212 211 213 212 - #endif /* __USBNET_H */ 214 + #endif /* __LINUX_USB_USBNET_H */