diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-07-15 04:59:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 15:01:12 -0400 |
commit | bbf4976e7715da4a3e3599a500eb20d6be8b5046 (patch) | |
tree | c7011166ad59ee60c9db93aa10ce5dd5c8f0d82b /drivers/usb/class | |
parent | f4d844cb6c073998db0c7fe3d76c6c070333054e (diff) |
usbtmc: remove redundant braces
There is a few cases where braces are not needed. This patch removes
unnecessary '& 255' pieces as well when lvalue type is u8.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/usbtmc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 21114ab99d96..d683f90a505b 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -393,12 +393,12 @@ static int send_request_dev_dep_msg_in(struct usbtmc_device_data *data, size_t t | |||
393 | */ | 393 | */ |
394 | buffer[0] = 2; | 394 | buffer[0] = 2; |
395 | buffer[1] = data->bTag; | 395 | buffer[1] = data->bTag; |
396 | buffer[2] = ~(data->bTag); | 396 | buffer[2] = ~data->bTag; |
397 | buffer[3] = 0; /* Reserved */ | 397 | buffer[3] = 0; /* Reserved */ |
398 | buffer[4] = (transfer_size) & 255; | 398 | buffer[4] = transfer_size >> 0; |
399 | buffer[5] = ((transfer_size) >> 8) & 255; | 399 | buffer[5] = transfer_size >> 8; |
400 | buffer[6] = ((transfer_size) >> 16) & 255; | 400 | buffer[6] = transfer_size >> 16; |
401 | buffer[7] = ((transfer_size) >> 24) & 255; | 401 | buffer[7] = transfer_size >> 24; |
402 | buffer[8] = data->TermCharEnabled * 2; | 402 | buffer[8] = data->TermCharEnabled * 2; |
403 | /* Use term character? */ | 403 | /* Use term character? */ |
404 | buffer[9] = data->TermChar; | 404 | buffer[9] = data->TermChar; |
@@ -417,7 +417,7 @@ static int send_request_dev_dep_msg_in(struct usbtmc_device_data *data, size_t t | |||
417 | /* Increment bTag -- and increment again if zero */ | 417 | /* Increment bTag -- and increment again if zero */ |
418 | data->bTag++; | 418 | data->bTag++; |
419 | if (!data->bTag) | 419 | if (!data->bTag) |
420 | (data->bTag)++; | 420 | data->bTag++; |
421 | 421 | ||
422 | if (retval < 0) { | 422 | if (retval < 0) { |
423 | dev_err(&data->intf->dev, "usb_bulk_msg in send_request_dev_dep_msg_in() returned %d\n", retval); | 423 | dev_err(&data->intf->dev, "usb_bulk_msg in send_request_dev_dep_msg_in() returned %d\n", retval); |
@@ -472,7 +472,7 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, | |||
472 | done = 0; | 472 | done = 0; |
473 | 473 | ||
474 | while (remaining > 0) { | 474 | while (remaining > 0) { |
475 | if (!(data->rigol_quirk)) { | 475 | if (!data->rigol_quirk) { |
476 | dev_dbg(dev, "usb_bulk_msg_in: remaining(%zu), count(%zu)\n", remaining, count); | 476 | dev_dbg(dev, "usb_bulk_msg_in: remaining(%zu), count(%zu)\n", remaining, count); |
477 | 477 | ||
478 | if (remaining > USBTMC_SIZE_IOBUFFER - USBTMC_HEADER_SIZE - 3) | 478 | if (remaining > USBTMC_SIZE_IOBUFFER - USBTMC_HEADER_SIZE - 3) |
@@ -509,7 +509,7 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, | |||
509 | } | 509 | } |
510 | 510 | ||
511 | /* Parse header in first packet */ | 511 | /* Parse header in first packet */ |
512 | if ((done == 0) || (!(data->rigol_quirk))) { | 512 | if ((done == 0) || !data->rigol_quirk) { |
513 | /* Sanity checks for the header */ | 513 | /* Sanity checks for the header */ |
514 | if (actual < USBTMC_HEADER_SIZE) { | 514 | if (actual < USBTMC_HEADER_SIZE) { |
515 | dev_err(dev, "Device sent too small first packet: %u < %u\n", actual, USBTMC_HEADER_SIZE); | 515 | dev_err(dev, "Device sent too small first packet: %u < %u\n", actual, USBTMC_HEADER_SIZE); |
@@ -569,7 +569,7 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, | |||
569 | remaining -= actual; | 569 | remaining -= actual; |
570 | 570 | ||
571 | /* Terminate if end-of-message bit received from device */ | 571 | /* Terminate if end-of-message bit received from device */ |
572 | if ((buffer[8] & 0x01) && (actual >= n_characters)) | 572 | if ((buffer[8] & 0x01) && (actual >= n_characters)) |
573 | remaining = 0; | 573 | remaining = 0; |
574 | 574 | ||
575 | dev_dbg(dev, "Bulk-IN header: remaining(%zu), buf(%p), buffer(%p) done(%zu)\n", remaining,buf,buffer,done); | 575 | dev_dbg(dev, "Bulk-IN header: remaining(%zu), buf(%p), buffer(%p) done(%zu)\n", remaining,buf,buffer,done); |
@@ -650,12 +650,12 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf, | |||
650 | /* Setup IO buffer for DEV_DEP_MSG_OUT message */ | 650 | /* Setup IO buffer for DEV_DEP_MSG_OUT message */ |
651 | buffer[0] = 1; | 651 | buffer[0] = 1; |
652 | buffer[1] = data->bTag; | 652 | buffer[1] = data->bTag; |
653 | buffer[2] = ~(data->bTag); | 653 | buffer[2] = ~data->bTag; |
654 | buffer[3] = 0; /* Reserved */ | 654 | buffer[3] = 0; /* Reserved */ |
655 | buffer[4] = this_part & 255; | 655 | buffer[4] = this_part >> 0; |
656 | buffer[5] = (this_part >> 8) & 255; | 656 | buffer[5] = this_part >> 8; |
657 | buffer[6] = (this_part >> 16) & 255; | 657 | buffer[6] = this_part >> 16; |
658 | buffer[7] = (this_part >> 24) & 255; | 658 | buffer[7] = this_part >> 24; |
659 | /* buffer[8] is set above... */ | 659 | /* buffer[8] is set above... */ |
660 | buffer[9] = 0; /* Reserved */ | 660 | buffer[9] = 0; /* Reserved */ |
661 | buffer[10] = 0; /* Reserved */ | 661 | buffer[10] = 0; /* Reserved */ |