Commit f9eacc98 authored by matt mooney's avatar matt mooney Committed by Greg Kroah-Hartman

staging: usbip: usbip_common.c: coding style cleanup

Fix alignment for consistency, checkpatch.pl warning of line over
80 characters, and remove extraneous lines.
Signed-off-by: default avatarmatt mooney <mfm@muteddisk.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4980d968
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
/* version information */ /* version information */
#define DRIVER_VERSION "1.0" #define DRIVER_VERSION "1.0"
#define DRIVER_AUTHOR "Takahiro Hirofuchi <hirofuchi _at_ users.sourceforge.net>" #define DRIVER_AUTHOR \
"Takahiro Hirofuchi <hirofuchi _at_ users.sourceforge.net>"
#define DRIVER_DESC "usbip common driver" #define DRIVER_DESC "usbip common driver"
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -40,12 +41,10 @@ unsigned long usbip_debug_flag; ...@@ -40,12 +41,10 @@ unsigned long usbip_debug_flag;
#endif #endif
EXPORT_SYMBOL_GPL(usbip_debug_flag); EXPORT_SYMBOL_GPL(usbip_debug_flag);
/* FIXME */ /* FIXME */
struct device_attribute dev_attr_usbip_debug; struct device_attribute dev_attr_usbip_debug;
EXPORT_SYMBOL_GPL(dev_attr_usbip_debug); EXPORT_SYMBOL_GPL(dev_attr_usbip_debug);
static ssize_t show_flag(struct device *dev, struct device_attribute *attr, static ssize_t show_flag(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
...@@ -56,7 +55,6 @@ static ssize_t store_flag(struct device *dev, struct device_attribute *attr, ...@@ -56,7 +55,6 @@ static ssize_t store_flag(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
sscanf(buf, "%lx", &usbip_debug_flag); sscanf(buf, "%lx", &usbip_debug_flag);
return count; return count;
} }
DEVICE_ATTR(usbip_debug, (S_IRUGO | S_IWUSR), show_flag, store_flag); DEVICE_ATTR(usbip_debug, (S_IRUGO | S_IWUSR), show_flag, store_flag);
...@@ -373,7 +371,6 @@ int usbip_xmit(int send, struct socket *sock, char *buf, ...@@ -373,7 +371,6 @@ int usbip_xmit(int send, struct socket *sock, char *buf,
return -EINVAL; return -EINVAL;
} }
if (usbip_dbg_flag_xmit) { if (usbip_dbg_flag_xmit) {
if (send) { if (send) {
if (!in_interrupt()) if (!in_interrupt())
...@@ -388,7 +385,6 @@ int usbip_xmit(int send, struct socket *sock, char *buf, ...@@ -388,7 +385,6 @@ int usbip_xmit(int send, struct socket *sock, char *buf,
} }
} }
do { do {
sock->sk->sk_allocation = GFP_NOIO; sock->sk->sk_allocation = GFP_NOIO;
iov.iov_base = buf; iov.iov_base = buf;
...@@ -408,9 +404,8 @@ int usbip_xmit(int send, struct socket *sock, char *buf, ...@@ -408,9 +404,8 @@ int usbip_xmit(int send, struct socket *sock, char *buf,
if (result <= 0) { if (result <= 0) {
usbip_udbg("usbip_xmit: %s sock %p buf %p size %u ret " usbip_udbg("usbip_xmit: %s sock %p buf %p size %u ret "
"%d total %d\n", "%d total %d\n", send ? "send" : "receive",
send ? "send" : "receive", sock, buf, sock, buf, size, result, total);
size, result, total);
goto err; goto err;
} }
...@@ -420,7 +415,6 @@ int usbip_xmit(int send, struct socket *sock, char *buf, ...@@ -420,7 +415,6 @@ int usbip_xmit(int send, struct socket *sock, char *buf,
} while (size > 0); } while (size > 0);
if (usbip_dbg_flag_xmit) { if (usbip_dbg_flag_xmit) {
if (!send) { if (!send) {
if (!in_interrupt()) if (!in_interrupt())
...@@ -431,8 +425,8 @@ int usbip_xmit(int send, struct socket *sock, char *buf, ...@@ -431,8 +425,8 @@ int usbip_xmit(int send, struct socket *sock, char *buf,
printk(KERN_DEBUG "usbip_xmit: receiving....\n"); printk(KERN_DEBUG "usbip_xmit: receiving....\n");
usbip_dump_buffer(bp, osize); usbip_dump_buffer(bp, osize);
printk(KERN_DEBUG "usbip_xmit: received, osize %d ret " printk(KERN_DEBUG "usbip_xmit: received, osize %d ret "
"%d size %d total %d\n", osize, result, "%d size %d total %d\n", osize, result, size,
size, total); total);
} }
if (send) if (send)
...@@ -470,8 +464,6 @@ struct socket *sockfd_to_socket(unsigned int sockfd) ...@@ -470,8 +464,6 @@ struct socket *sockfd_to_socket(unsigned int sockfd)
} }
EXPORT_SYMBOL_GPL(sockfd_to_socket); EXPORT_SYMBOL_GPL(sockfd_to_socket);
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* pdu routines */ /* pdu routines */
...@@ -534,7 +526,6 @@ static void usbip_pack_ret_submit(struct usbip_header *pdu, struct urb *urb, ...@@ -534,7 +526,6 @@ static void usbip_pack_ret_submit(struct usbip_header *pdu, struct urb *urb,
} }
} }
void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd, void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd,
int pack) int pack)
{ {
...@@ -553,7 +544,6 @@ void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd, ...@@ -553,7 +544,6 @@ void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd,
} }
EXPORT_SYMBOL_GPL(usbip_pack_pdu); EXPORT_SYMBOL_GPL(usbip_pack_pdu);
static void correct_endian_basic(struct usbip_header_basic *base, int send) static void correct_endian_basic(struct usbip_header_basic *base, int send)
{ {
if (send) { if (send) {
...@@ -694,7 +684,6 @@ static void usbip_pack_iso(struct usbip_iso_packet_descriptor *iso, ...@@ -694,7 +684,6 @@ static void usbip_pack_iso(struct usbip_iso_packet_descriptor *iso,
} }
} }
/* must free buffer */ /* must free buffer */
void *usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen) void *usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen)
{ {
...@@ -760,7 +749,6 @@ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb) ...@@ -760,7 +749,6 @@ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb)
return -EPIPE; return -EPIPE;
} }
for (i = 0; i < np; i++) { for (i = 0; i < np; i++) {
iso = buff + (i * sizeof(*iso)); iso = buff + (i * sizeof(*iso));
...@@ -773,7 +761,8 @@ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb) ...@@ -773,7 +761,8 @@ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb)
if (total_length != urb->actual_length) { if (total_length != urb->actual_length) {
dev_err(&urb->dev->dev, dev_err(&urb->dev->dev,
"total length of iso packets (%d) not equal to actual length of buffer (%d)\n", "total length of iso packets %d not equal to actual "
"length of buffer %d\n",
total_length, urb->actual_length); total_length, urb->actual_length);
if (ud->side == USBIP_STUB) if (ud->side == USBIP_STUB)
...@@ -826,6 +815,7 @@ int usbip_pad_iso(struct usbip_device *ud, struct urb *urb) ...@@ -826,6 +815,7 @@ int usbip_pad_iso(struct usbip_device *ud, struct urb *urb)
urb->transfer_buffer + actualoffset, urb->transfer_buffer + actualoffset,
urb->iso_frame_desc[i].actual_length); urb->iso_frame_desc[i].actual_length);
} }
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(usbip_pad_iso); EXPORT_SYMBOL_GPL(usbip_pad_iso);
...@@ -872,13 +862,11 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb) ...@@ -872,13 +862,11 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb)
} }
EXPORT_SYMBOL_GPL(usbip_recv_xbuff); EXPORT_SYMBOL_GPL(usbip_recv_xbuff);
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init usbip_common_init(void) static int __init usbip_common_init(void)
{ {
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "" DRIVER_VERSION); printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "" DRIVER_VERSION);
return 0; return 0;
} }
...@@ -887,9 +875,6 @@ static void __exit usbip_common_exit(void) ...@@ -887,9 +875,6 @@ static void __exit usbip_common_exit(void)
return; return;
} }
module_init(usbip_common_init); module_init(usbip_common_init);
module_exit(usbip_common_exit); module_exit(usbip_common_exit);
......
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