Commit 9db91e1b authored by Kurt Kanzenbach's avatar Kurt Kanzenbach Committed by Greg Kroah-Hartman

staging: usbip: userspace: libsrc: replaced lines over 80 characters

This patch fixes some of the following checkpatch warnings:
-WARNING: line over 80 characters

We did not split format strings for readability.
Signed-off-by: default avatarKurt Kanzenbach <ly80toro@cip.cs.fau.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71bd5b76
...@@ -40,7 +40,8 @@ extern const char *names_vendor(u_int16_t vendorid); ...@@ -40,7 +40,8 @@ extern const char *names_vendor(u_int16_t vendorid);
extern const char *names_product(u_int16_t vendorid, u_int16_t productid); extern const char *names_product(u_int16_t vendorid, u_int16_t productid);
extern const char *names_class(u_int8_t classid); extern const char *names_class(u_int8_t classid);
extern const char *names_subclass(u_int8_t classid, u_int8_t subclassid); extern const char *names_subclass(u_int8_t classid, u_int8_t subclassid);
extern const char *names_protocol(u_int8_t classid, u_int8_t subclassid, u_int8_t protocolid); extern const char *names_protocol(u_int8_t classid, u_int8_t subclassid,
u_int8_t protocolid);
extern const char *names_audioterminal(u_int16_t termt); extern const char *names_audioterminal(u_int16_t termt);
extern const char *names_hid(u_int8_t hidd); extern const char *names_hid(u_int8_t hidd);
extern const char *names_reporttag(u_int8_t rt); extern const char *names_reporttag(u_int8_t rt);
......
...@@ -109,7 +109,8 @@ void dump_usb_device(struct usbip_usb_device *udev) ...@@ -109,7 +109,8 @@ void dump_usb_device(struct usbip_usb_device *udev)
} }
int read_attr_value(struct sysfs_device *dev, const char *name, const char *format) int read_attr_value(struct sysfs_device *dev, const char *name,
const char *format)
{ {
char attrpath[SYSFS_PATH_MAX]; char attrpath[SYSFS_PATH_MAX];
struct sysfs_attribute *attr; struct sysfs_attribute *attr;
...@@ -180,8 +181,11 @@ int read_attr_speed(struct sysfs_device *dev) ...@@ -180,8 +181,11 @@ int read_attr_speed(struct sysfs_device *dev)
return USB_SPEED_UNKNOWN; return USB_SPEED_UNKNOWN;
} }
#define READ_ATTR(object, type, dev, name, format)\ #define READ_ATTR(object, type, dev, name, format) \
do { (object)->name = (type) read_attr_value(dev, to_string(name), format); } while (0) do { \
(object)->name = (type) read_attr_value(dev, to_string(name), \
format); \
} while (0)
int read_usb_device(struct sysfs_device *sdev, struct usbip_usb_device *udev) int read_usb_device(struct sysfs_device *sdev, struct usbip_usb_device *udev)
...@@ -245,7 +249,8 @@ void usbip_names_free() ...@@ -245,7 +249,8 @@ void usbip_names_free()
names_free(); names_free();
} }
void usbip_names_get_product(char *buff, size_t size, uint16_t vendor, uint16_t product) void usbip_names_get_product(char *buff, size_t size, uint16_t vendor,
uint16_t product)
{ {
const char *prod, *vend; const char *prod, *vend;
...@@ -261,7 +266,8 @@ void usbip_names_get_product(char *buff, size_t size, uint16_t vendor, uint16_t ...@@ -261,7 +266,8 @@ void usbip_names_get_product(char *buff, size_t size, uint16_t vendor, uint16_t
snprintf(buff, size, "%s : %s (%04x:%04x)", vend, prod, vendor, product); snprintf(buff, size, "%s : %s (%04x:%04x)", vend, prod, vendor, product);
} }
void usbip_names_get_class(char *buff, size_t size, uint8_t class, uint8_t subclass, uint8_t protocol) void usbip_names_get_class(char *buff, size_t size, uint8_t class,
uint8_t subclass, uint8_t protocol)
{ {
const char *c, *s, *p; const char *c, *s, *p;
......
...@@ -132,7 +132,8 @@ struct usbip_usb_device { ...@@ -132,7 +132,8 @@ struct usbip_usb_device {
void dump_usb_interface(struct usbip_usb_interface *); void dump_usb_interface(struct usbip_usb_interface *);
void dump_usb_device(struct usbip_usb_device *); void dump_usb_device(struct usbip_usb_device *);
int read_usb_device(struct sysfs_device *sdev, struct usbip_usb_device *udev); int read_usb_device(struct sysfs_device *sdev, struct usbip_usb_device *udev);
int read_attr_value(struct sysfs_device *dev, const char *name, const char *format); int read_attr_value(struct sysfs_device *dev, const char *name,
const char *format);
int read_usb_interface(struct usbip_usb_device *udev, int i, int read_usb_interface(struct usbip_usb_device *udev, int i,
struct usbip_usb_interface *uinf); struct usbip_usb_interface *uinf);
...@@ -141,7 +142,9 @@ const char *usbip_status_string(int32_t status); ...@@ -141,7 +142,9 @@ const char *usbip_status_string(int32_t status);
int usbip_names_init(char *); int usbip_names_init(char *);
void usbip_names_free(void); void usbip_names_free(void);
void usbip_names_get_product(char *buff, size_t size, uint16_t vendor, uint16_t product); void usbip_names_get_product(char *buff, size_t size, uint16_t vendor,
void usbip_names_get_class(char *buff, size_t size, uint8_t class, uint8_t subclass, uint8_t protocol); uint16_t product);
void usbip_names_get_class(char *buff, size_t size, uint8_t class,
uint8_t subclass, uint8_t protocol);
#endif /* __USBIP_COMMON_H */ #endif /* __USBIP_COMMON_H */
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
struct usbip_vhci_driver *vhci_driver; struct usbip_vhci_driver *vhci_driver;
static struct usbip_imported_device *imported_device_init(struct usbip_imported_device *idev, char *busid) static struct usbip_imported_device *
imported_device_init(struct usbip_imported_device *idev, char *busid)
{ {
struct sysfs_device *sudev; struct sysfs_device *sudev;
...@@ -29,8 +30,10 @@ static struct usbip_imported_device *imported_device_init(struct usbip_imported_ ...@@ -29,8 +30,10 @@ static struct usbip_imported_device *imported_device_init(struct usbip_imported_
if (!strncmp(cdev->dev_path, idev->udev.path, if (!strncmp(cdev->dev_path, idev->udev.path,
strlen(idev->udev.path))) { strlen(idev->udev.path))) {
struct usbip_class_device *new_cdev; struct usbip_class_device *new_cdev;
/*
/* alloc and copy because dlist is linked from only one list */ * alloc and copy because dlist is linked
* from only one list
*/
new_cdev = calloc(1, sizeof(*new_cdev)); new_cdev = calloc(1, sizeof(*new_cdev));
if (!new_cdev) if (!new_cdev)
goto err; goto err;
...@@ -101,7 +104,8 @@ static int parse_status(char *value) ...@@ -101,7 +104,8 @@ static int parse_status(char *value)
return -1; return -1;
} }
if (idev->status != VDEV_ST_NULL && idev->status != VDEV_ST_NOTASSIGNED) { if (idev->status != VDEV_ST_NULL
&& idev->status != VDEV_ST_NOTASSIGNED) {
idev = imported_device_init(idev, lbusid); idev = imported_device_init(idev, lbusid);
if (!idev) { if (!idev) {
dbg("imported_device_init failed"); dbg("imported_device_init failed");
...@@ -126,8 +130,10 @@ static int parse_status(char *value) ...@@ -126,8 +130,10 @@ static int parse_status(char *value)
static int check_usbip_device(struct sysfs_class_device *cdev) static int check_usbip_device(struct sysfs_class_device *cdev)
{ {
char class_path[SYSFS_PATH_MAX]; /* /sys/class/video4linux/video0/device */ /* /sys/class/video4linux/video0/device */
char dev_path[SYSFS_PATH_MAX]; /* /sys/devices/platform/vhci_hcd/usb6/6-1:1.1 */ char class_path[SYSFS_PATH_MAX];
/* /sys/devices/platform/vhci_hcd/usb6/6-1:1.1 */
char dev_path[SYSFS_PATH_MAX];
int ret; int ret;
struct usbip_class_device *usbip_cdev; struct usbip_class_device *usbip_cdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment