diff options
| author | Alan Stern <stern@rowland.harvard.edu> | 2005-10-24 15:36:00 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 19:47:51 -0400 |
| commit | b724ae77969fd832be71419dca74bece9af287ff (patch) | |
| tree | a38ed0337bf012db4c8deec2c33d3e4ff78a2b6a | |
| parent | 0e6c8e8db508fcb292836b23d039649c5de29090 (diff) | |
[PATCH] usbcore: Wrap lines before column 80
I can't stand text lines that wrap-around in my 80-column windows. This
patch (as589) makes cosmetic changes to a couple of source files.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| -rw-r--r-- | drivers/usb/core/sysfs.c | 30 | ||||
| -rw-r--r-- | include/linux/usb.h | 132 |
2 files changed, 106 insertions, 56 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index f18317fb49ee..4cca77cf0c48 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
| @@ -221,7 +221,8 @@ static void usb_remove_ep_files(struct usb_host_endpoint *endpoint) | |||
| 221 | 221 | ||
| 222 | /* Active configuration fields */ | 222 | /* Active configuration fields */ |
| 223 | #define usb_actconfig_show(field, multiplier, format_string) \ | 223 | #define usb_actconfig_show(field, multiplier, format_string) \ |
| 224 | static ssize_t show_##field (struct device *dev, struct device_attribute *attr, char *buf) \ | 224 | static ssize_t show_##field (struct device *dev, \ |
| 225 | struct device_attribute *attr, char *buf) \ | ||
| 225 | { \ | 226 | { \ |
| 226 | struct usb_device *udev; \ | 227 | struct usb_device *udev; \ |
| 227 | struct usb_host_config *actconfig; \ | 228 | struct usb_host_config *actconfig; \ |
| @@ -243,7 +244,8 @@ usb_actconfig_attr (bNumInterfaces, 1, "%2d\n") | |||
| 243 | usb_actconfig_attr (bmAttributes, 1, "%2x\n") | 244 | usb_actconfig_attr (bmAttributes, 1, "%2x\n") |
| 244 | usb_actconfig_attr (bMaxPower, 2, "%3dmA\n") | 245 | usb_actconfig_attr (bMaxPower, 2, "%3dmA\n") |
| 245 | 246 | ||
| 246 | static ssize_t show_configuration_string(struct device *dev, struct device_attribute *attr, char *buf) | 247 | static ssize_t show_configuration_string(struct device *dev, |
| 248 | struct device_attribute *attr, char *buf) | ||
| 247 | { | 249 | { |
| 248 | struct usb_device *udev; | 250 | struct usb_device *udev; |
| 249 | struct usb_host_config *actconfig; | 251 | struct usb_host_config *actconfig; |
| @@ -266,7 +268,8 @@ static DEVICE_ATTR(configuration, S_IRUGO, show_configuration_string, NULL); | |||
| 266 | usb_actconfig_show(bConfigurationValue, 1, "%u\n"); | 268 | usb_actconfig_show(bConfigurationValue, 1, "%u\n"); |
| 267 | 269 | ||
| 268 | static ssize_t | 270 | static ssize_t |
| 269 | set_bConfigurationValue (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 271 | set_bConfigurationValue (struct device *dev, struct device_attribute *attr, |
| 272 | const char *buf, size_t count) | ||
| 270 | { | 273 | { |
| 271 | struct usb_device *udev = udev = to_usb_device (dev); | 274 | struct usb_device *udev = udev = to_usb_device (dev); |
| 272 | int config, value; | 275 | int config, value; |
| @@ -284,7 +287,8 @@ static DEVICE_ATTR(bConfigurationValue, S_IRUGO | S_IWUSR, | |||
| 284 | 287 | ||
| 285 | /* String fields */ | 288 | /* String fields */ |
| 286 | #define usb_string_attr(name) \ | 289 | #define usb_string_attr(name) \ |
| 287 | static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \ | 290 | static ssize_t show_##name(struct device *dev, \ |
| 291 | struct device_attribute *attr, char *buf) \ | ||
| 288 | { \ | 292 | { \ |
| 289 | struct usb_device *udev; \ | 293 | struct usb_device *udev; \ |
| 290 | int len; \ | 294 | int len; \ |
| @@ -364,7 +368,8 @@ static DEVICE_ATTR(maxchild, S_IRUGO, show_maxchild, NULL); | |||
| 364 | /* Descriptor fields */ | 368 | /* Descriptor fields */ |
| 365 | #define usb_descriptor_attr_le16(field, format_string) \ | 369 | #define usb_descriptor_attr_le16(field, format_string) \ |
| 366 | static ssize_t \ | 370 | static ssize_t \ |
| 367 | show_##field (struct device *dev, struct device_attribute *attr, char *buf) \ | 371 | show_##field (struct device *dev, struct device_attribute *attr, \ |
| 372 | char *buf) \ | ||
| 368 | { \ | 373 | { \ |
| 369 | struct usb_device *udev; \ | 374 | struct usb_device *udev; \ |
| 370 | \ | 375 | \ |
| @@ -380,7 +385,8 @@ usb_descriptor_attr_le16(bcdDevice, "%04x\n") | |||
| 380 | 385 | ||
| 381 | #define usb_descriptor_attr(field, format_string) \ | 386 | #define usb_descriptor_attr(field, format_string) \ |
| 382 | static ssize_t \ | 387 | static ssize_t \ |
| 383 | show_##field (struct device *dev, struct device_attribute *attr, char *buf) \ | 388 | show_##field (struct device *dev, struct device_attribute *attr, \ |
| 389 | char *buf) \ | ||
| 384 | { \ | 390 | { \ |
| 385 | struct usb_device *udev; \ | 391 | struct usb_device *udev; \ |
| 386 | \ | 392 | \ |
| @@ -455,11 +461,13 @@ void usb_remove_sysfs_dev_files (struct usb_device *udev) | |||
| 455 | /* Interface fields */ | 461 | /* Interface fields */ |
| 456 | #define usb_intf_attr(field, format_string) \ | 462 | #define usb_intf_attr(field, format_string) \ |
| 457 | static ssize_t \ | 463 | static ssize_t \ |
| 458 | show_##field (struct device *dev, struct device_attribute *attr, char *buf) \ | 464 | show_##field (struct device *dev, struct device_attribute *attr, \ |
| 465 | char *buf) \ | ||
| 459 | { \ | 466 | { \ |
| 460 | struct usb_interface *intf = to_usb_interface (dev); \ | 467 | struct usb_interface *intf = to_usb_interface (dev); \ |
| 461 | \ | 468 | \ |
| 462 | return sprintf (buf, format_string, intf->cur_altsetting->desc.field); \ | 469 | return sprintf (buf, format_string, \ |
| 470 | intf->cur_altsetting->desc.field); \ | ||
| 463 | } \ | 471 | } \ |
| 464 | static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL); | 472 | static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL); |
| 465 | 473 | ||
| @@ -470,7 +478,8 @@ usb_intf_attr (bInterfaceClass, "%02x\n") | |||
| 470 | usb_intf_attr (bInterfaceSubClass, "%02x\n") | 478 | usb_intf_attr (bInterfaceSubClass, "%02x\n") |
| 471 | usb_intf_attr (bInterfaceProtocol, "%02x\n") | 479 | usb_intf_attr (bInterfaceProtocol, "%02x\n") |
| 472 | 480 | ||
| 473 | static ssize_t show_interface_string(struct device *dev, struct device_attribute *attr, char *buf) | 481 | static ssize_t show_interface_string(struct device *dev, |
| 482 | struct device_attribute *attr, char *buf) | ||
| 474 | { | 483 | { |
| 475 | struct usb_interface *intf; | 484 | struct usb_interface *intf; |
| 476 | struct usb_device *udev; | 485 | struct usb_device *udev; |
| @@ -487,7 +496,8 @@ static ssize_t show_interface_string(struct device *dev, struct device_attribute | |||
| 487 | } | 496 | } |
| 488 | static DEVICE_ATTR(interface, S_IRUGO, show_interface_string, NULL); | 497 | static DEVICE_ATTR(interface, S_IRUGO, show_interface_string, NULL); |
| 489 | 498 | ||
| 490 | static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, char *buf) | 499 | static ssize_t show_modalias(struct device *dev, |
| 500 | struct device_attribute *attr, char *buf) | ||
| 491 | { | 501 | { |
| 492 | struct usb_interface *intf; | 502 | struct usb_interface *intf; |
| 493 | struct usb_device *udev; | 503 | struct usb_device *udev; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 465ff4585ca5..c500d6b5a16d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -137,7 +137,8 @@ struct usb_interface { | |||
| 137 | * active alternate setting */ | 137 | * active alternate setting */ |
| 138 | unsigned num_altsetting; /* number of alternate settings */ | 138 | unsigned num_altsetting; /* number of alternate settings */ |
| 139 | 139 | ||
| 140 | int minor; /* minor number this interface is bound to */ | 140 | int minor; /* minor number this interface is |
| 141 | * bound to */ | ||
| 141 | enum usb_interface_condition condition; /* state of binding */ | 142 | enum usb_interface_condition condition; /* state of binding */ |
| 142 | struct device dev; /* interface specific device info */ | 143 | struct device dev; /* interface specific device info */ |
| 143 | struct class_device *class_dev; | 144 | struct class_device *class_dev; |
| @@ -249,7 +250,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
| 249 | __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ | 250 | __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ |
| 250 | type,(void**)ptr) | 251 | type,(void**)ptr) |
| 251 | 252 | ||
| 252 | /* -------------------------------------------------------------------------- */ | 253 | /* ----------------------------------------------------------------------- */ |
| 253 | 254 | ||
| 254 | struct usb_operations; | 255 | struct usb_operations; |
| 255 | 256 | ||
| @@ -269,7 +270,8 @@ struct usb_bus { | |||
| 269 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 270 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
| 270 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 271 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
| 271 | 272 | ||
| 272 | int devnum_next; /* Next open device number in round-robin allocation */ | 273 | int devnum_next; /* Next open device number in |
| 274 | * round-robin allocation */ | ||
| 273 | 275 | ||
| 274 | struct usb_devmap devmap; /* device address allocation map */ | 276 | struct usb_devmap devmap; /* device address allocation map */ |
| 275 | struct usb_operations *op; /* Operations (specific to the HC) */ | 277 | struct usb_operations *op; /* Operations (specific to the HC) */ |
| @@ -290,15 +292,16 @@ struct usb_bus { | |||
| 290 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 292 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
| 291 | 293 | ||
| 292 | struct class_device *class_dev; /* class device for this bus */ | 294 | struct class_device *class_dev; /* class device for this bus */ |
| 293 | struct kref kref; /* handles reference counting this bus */ | 295 | struct kref kref; /* reference counting for this bus */ |
| 294 | void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ | 296 | void (*release)(struct usb_bus *bus); |
| 297 | |||
| 295 | #if defined(CONFIG_USB_MON) | 298 | #if defined(CONFIG_USB_MON) |
| 296 | struct mon_bus *mon_bus; /* non-null when associated */ | 299 | struct mon_bus *mon_bus; /* non-null when associated */ |
| 297 | int monitored; /* non-zero when monitored */ | 300 | int monitored; /* non-zero when monitored */ |
| 298 | #endif | 301 | #endif |
| 299 | }; | 302 | }; |
| 300 | 303 | ||
| 301 | /* -------------------------------------------------------------------------- */ | 304 | /* ----------------------------------------------------------------------- */ |
| 302 | 305 | ||
| 303 | /* This is arbitrary. | 306 | /* This is arbitrary. |
| 304 | * From USB 2.0 spec Table 11-13, offset 7, a hub can | 307 | * From USB 2.0 spec Table 11-13, offset 7, a hub can |
| @@ -327,7 +330,8 @@ struct usb_device { | |||
| 327 | < | ||
