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

USB: skeleton: fix coding style issues.

This fixes up the majority of the coding style issues in the
usb-skeleton driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+28 -15
+28 -15
drivers/usb/usb-skeleton.c
··· 18 18 #include <linux/slab.h> 19 19 #include <linux/module.h> 20 20 #include <linux/kref.h> 21 - #include <asm/uaccess.h> 21 + #include <linux/uaccess.h> 22 22 #include <linux/usb.h> 23 23 #include <linux/mutex.h> 24 24 ··· 28 28 #define USB_SKEL_PRODUCT_ID 0xfff0 29 29 30 30 /* table of devices that work with this driver */ 31 - static struct usb_device_id skel_table [] = { 31 + static struct usb_device_id skel_table[] = { 32 32 { USB_DEVICE(USB_SKEL_VENDOR_ID, USB_SKEL_PRODUCT_ID) }, 33 33 { } /* Terminating entry */ 34 34 }; ··· 94 94 95 95 interface = usb_find_interface(&skel_driver, subminor); 96 96 if (!interface) { 97 - err ("%s - error, can't find device for minor %d", 97 + err("%s - error, can't find device for minor %d", 98 98 __func__, subminor); 99 99 retval = -ENODEV; 100 100 goto exit; ··· 190 190 spin_lock(&dev->err_lock); 191 191 /* sync/async unlink faults aren't errors */ 192 192 if (urb->status) { 193 - if(!(urb->status == -ENOENT || 193 + if (!(urb->status == -ENOENT || 194 194 urb->status == -ECONNRESET || 195 195 urb->status == -ESHUTDOWN)) 196 196 err("%s - nonzero write bulk status received: %d", ··· 239 239 return rv; 240 240 } 241 241 242 - static ssize_t skel_read(struct file *file, char *buffer, size_t count, loff_t *ppos) 242 + static ssize_t skel_read(struct file *file, char *buffer, size_t count, 243 + loff_t *ppos) 243 244 { 244 245 struct usb_skel *dev; 245 246 int rv; ··· 300 299 } 301 300 302 301 /* errors must be reported */ 303 - if ((rv = dev->errors) < 0) { 302 + rv = dev->errors; 303 + if (rv < 0) { 304 304 /* any error is reported once */ 305 305 dev->errors = 0; 306 306 /* to preserve notifications about reset */ ··· 375 373 376 374 /* sync/async unlink faults aren't errors */ 377 375 if (urb->status) { 378 - if(!(urb->status == -ENOENT || 376 + if (!(urb->status == -ENOENT || 379 377 urb->status == -ECONNRESET || 380 378 urb->status == -ESHUTDOWN)) 381 379 err("%s - nonzero write bulk status received: %d", ··· 392 390 up(&dev->limit_sem); 393 391 } 394 392 395 - static ssize_t skel_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos) 393 + static ssize_t skel_write(struct file *file, const char *user_buffer, 394 + size_t count, loff_t *ppos) 396 395 { 397 396 struct usb_skel *dev; 398 397 int retval = 0; ··· 407 404 if (count == 0) 408 405 goto exit; 409 406 410 - /* limit the number of URBs in flight to stop a user from using up all RAM */ 407 + /* 408 + * limit the number of URBs in flight to stop a user from using up all 409 + * RAM 410 + */ 411 411 if (!file->f_flags & O_NONBLOCK) { 412 412 if (down_interruptible(&dev->limit_sem)) { 413 413 retval = -ERESTARTSYS; ··· 424 418 } 425 419 426 420 spin_lock_irq(&dev->err_lock); 427 - if ((retval = dev->errors) < 0) { 421 + retval = dev->errors; 422 + if (retval < 0) { 428 423 /* any error is reported once */ 429 424 dev->errors = 0; 430 425 /* to preserve notifications about reset */ ··· 442 435 goto error; 443 436 } 444 437 445 - buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL, &urb->transfer_dma); 438 + buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL, 439 + &urb->transfer_dma); 446 440 if (!buf) { 447 441 retval = -ENOMEM; 448 442 goto error; ··· 473 465 retval = usb_submit_urb(urb, GFP_KERNEL); 474 466 mutex_unlock(&dev->io_mutex); 475 467 if (retval) { 476 - err("%s - failed submitting write urb, error %d", __func__, retval); 468 + err("%s - failed submitting write urb, error %d", __func__, 469 + retval); 477 470 goto error_unanchor; 478 471 } 479 472 480 - /* release our reference to this urb, the USB core will eventually free it entirely */ 473 + /* 474 + * release our reference to this urb, the USB core will eventually free 475 + * it entirely 476 + */ 481 477 usb_free_urb(urb); 482 478 483 479 ··· 519 507 .minor_base = USB_SKEL_MINOR_BASE, 520 508 }; 521 509 522 - static int skel_probe(struct usb_interface *interface, const struct usb_device_id *id) 510 + static int skel_probe(struct usb_interface *interface, 511 + const struct usb_device_id *id) 523 512 { 524 513 struct usb_skel *dev; 525 514 struct usb_host_interface *iface_desc; ··· 649 636 return 0; 650 637 } 651 638 652 - static int skel_resume (struct usb_interface *intf) 639 + static int skel_resume(struct usb_interface *intf) 653 640 { 654 641 return 0; 655 642 }