From: Ilpo Järvinen Date: Thu, 30 Oct 2008 11:56:47 +0000 (+0200) Subject: USB: usbtmc: indent & braces disagree, something else is desired X-Git-Tag: v2.6.29-rc1~182^2~106 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=857cc4dfb6420ec0a67b3cda559aaa7c429ddce7;p=linux-2.6-omap-h63xx.git USB: usbtmc: indent & braces disagree, something else is desired It seems that there's rather involved way to say something which is commonly written in a plain simple form. Some type changes would probably be necessary to get gcc to do bitops instead of divide but it's no worse after my change than before I think. Signed-off-by: Ilpo Järvinen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 43a863c5cc4..0f5c05f6f9d 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -482,7 +483,6 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf, int retval; int actual; unsigned long int n_bytes; - int n; int remaining; int done; int this_part; @@ -526,11 +526,8 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf, goto exit; } - n_bytes = 12 + this_part; - if (this_part % 4) - n_bytes += 4 - this_part % 4; - for (n = 12 + this_part; n < n_bytes; n++) - buffer[n] = 0; + n_bytes = roundup(12 + this_part, 4); + memset(buffer + 12 + this_part, 0, n_bytes - (12 + this_part)); retval = usb_bulk_msg(data->usb_dev, usb_sndbulkpipe(data->usb_dev,