Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1536946 > unrolled thread

[PATCH 1/1] Fixed to checkpatch errors to usbtmc.c

Started byOzgur Karatas <okaratas@member.fsf.org>
First post2016-12-06 14:00 +0100
Last post2016-12-07 09:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] Fixed to checkpatch errors to usbtmc.c Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-06 14:00 +0100
    Re: [PATCH 1/1] Fixed to checkpatch errors to usbtmc.c Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-12-07 09:30 +0100

#1536946 — [PATCH 1/1] Fixed to checkpatch errors to usbtmc.c

FromOzgur Karatas <okaratas@member.fsf.org>
Date2016-12-06 14:00 +0100
Subject[PATCH 1/1] Fixed to checkpatch errors to usbtmc.c
Message-ID<sLnvH-29V-9@gated-at.bofh.it>
Hello all,

I will solve a checkpatch.pl script errors.

drivers/usb/class/usbtmc.c:719: ERROR: else should follow close brace '}'
drivers/usb/class/usbtmc.c:735: ERROR: space required after that ',' (ctx:VxV)
drivers/usb/class/usbtmc.c:735: ERROR: space required after that ',' (ctx:VxV)
drivers/usb/class/usbtmc.c:735: ERROR: space required after that ',' (ctx:VxV)
drivers/usb/class/usbtmc.c:746: ERROR: else should follow close brace '}'
drivers/usb/class/usbtmc.c:752: ERROR: space required after that ',' (ctx:VxV)
drivers/usb/class/usbtmc.c:752: ERROR: space required after that ',' (ctx:VxV)
drivers/usb/class/usbtmc.c:1403: ERROR: space required before the open parenthesis '('
total: 8 errors, 25 warnings, 1558 lines checked

Regards,

Signed-off-by: Ozgur Karatas <okaratas@member.fsf.org>
---
 drivers/usb/class/usbtmc.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index a6c1fae..3b29871 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -715,8 +715,7 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf,
 				/* Remove padding if it exists */
 				if (actual > remaining)
 					actual = remaining;
-			}
-			else {
+			} else {
 				if (this_part > n_characters)
 					this_part = n_characters;
 				/* Remove padding if it exists */
@@ -732,7 +731,7 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf,
 			if ((buffer[8] & 0x01) && (actual >= n_characters))
 				remaining = 0;
 
-			dev_dbg(dev, "Bulk-IN header: remaining(%zu), buf(%p), buffer(%p) done(%zu)\n", remaining,buf,buffer,done);
+			dev_dbg(dev, "Bulk-IN header: remaining(%zu), buf(%p), buffer(%p) done(%zu)\n", remaining, buf, buffer, done);
 
 
 			/* Copy buffer to user space */
@@ -742,14 +741,13 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf,
 				goto exit;
 			}
 			done += actual;
-		}
-		else  {
+		} else  {
 			if (actual > remaining)
 				actual = remaining;
 
 			remaining -= actual;
 
-			dev_dbg(dev, "Bulk-IN header cont: actual(%u), done(%zu), remaining(%zu), buf(%p), buffer(%p)\n", actual, done, remaining,buf,buffer);
+			dev_dbg(dev, "Bulk-IN header cont: actual(%u), done(%zu), remaining(%zu), buf(%p), buffer(%p)\n", actual, done, remaining, buf, buffer);
 
 			/* Copy buffer to user space */
 			if (copy_to_user(buf + done, buffer, actual)) {
@@ -1400,7 +1398,7 @@ static int usbtmc_probe(struct usb_interface *intf,
 	dev_dbg(&intf->dev, "Trying to find if device Vendor 0x%04X Product 0x%04X has the RIGOL quirk\n",
 		le16_to_cpu(data->usb_dev->descriptor.idVendor),
 		le16_to_cpu(data->usb_dev->descriptor.idProduct));
-	for(n = 0; usbtmc_id_quirk[n].idVendor > 0; n++) {
+	for (n = 0; usbtmc_id_quirk[n].idVendor > 0; n++) {
 		if ((usbtmc_id_quirk[n].idVendor == le16_to_cpu(data->usb_dev->descriptor.idVendor)) &&
 		    (usbtmc_id_quirk[n].idProduct == le16_to_cpu(data->usb_dev->descriptor.idProduct))) {
 			dev_dbg(&intf->dev, "Setting this device as having the RIGOL quirk\n");
-- 
2.1.4

[toc] | [next] | [standalone]


#1537602

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-12-07 09:30 +0100
Message-ID<sLFLX-65b-9@gated-at.bofh.it>
In reply to#1536946
On Tue, Dec 06, 2016 at 02:57:00PM +0200, Ozgur Karatas wrote:
> Hello all,

This isn't needed in a changelog text.

> I will solve a checkpatch.pl script errors.

> drivers/usb/class/usbtmc.c:719: ERROR: else should follow close brace '}'
> drivers/usb/class/usbtmc.c:735: ERROR: space required after that ',' (ctx:VxV)
> drivers/usb/class/usbtmc.c:735: ERROR: space required after that ',' (ctx:VxV)
> drivers/usb/class/usbtmc.c:735: ERROR: space required after that ',' (ctx:VxV)
> drivers/usb/class/usbtmc.c:746: ERROR: else should follow close brace '}'
> drivers/usb/class/usbtmc.c:752: ERROR: space required after that ',' (ctx:VxV)
> drivers/usb/class/usbtmc.c:752: ERROR: space required after that ',' (ctx:VxV)
> drivers/usb/class/usbtmc.c:1403: ERROR: space required before the open parenthesis '('
> total: 8 errors, 25 warnings, 1558 lines checked

Please break this up into one patch per "type" of fix please.

> Regards,

This isn't needed either :)

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web