Skip to contentSkip to conversation

usb: storage : Remove c99 style commenting

PATCH In review Sunny Kumar 3 participants 4 messages Jun 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: storage : Remove c99 style commenting

This patch fixes checkpatch.pl warning c99 style commenting.

---
 drivers/usb/storage/sddr55.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/storage/sddr55.c +8 -8
index aacedef..54d0a59 100644
@@ -209,10 +209,10 @@ static int sddr55_read_data(struct us_data *us,
 	unsigned int len, offset;
 	struct scatterlist *sg;
 
-	// Since we only read in one block at a time, we have to create
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only read in one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */
 	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
 			info->smallpageshift) * PAGESIZE;
 	buffer = kmalloc(len, GFP_NOIO);
@@ -336,10 +336,10 @@ static int sddr55_write_data(struct us_data *us,
 		return USB_STOR_TRANSPORT_FAILED;
 	}
 
-	// Since we only write one block at a time, we have to create
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only write one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */
 	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
 			info->smallpageshift) * PAGESIZE;
 	buffer = kmalloc(len, GFP_NOIO);
Signature · 1 line
2.1.4
#1 lore raw

Hello.

Quoted 13 lines · Sunny Kumar

This patch fixes checkpatch.pl warning c99 style commenting.

---
  drivers/usb/storage/sddr55.c | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/storage/sddr55.c +0 -0
index aacedef..54d0a59 100644
@@ -209,10 +209,10 @@ static int sddr55_read_data(struct us_data *us,
  	unsigned int len, offset;

drivers/usb/storage/sddr55.c static int sddr55_read_data(struct us_data *us, · line 215

Quoted 10 lines
drivers/usb/storage/sddr55.c +4 -4
  	struct scatterlist *sg;
 
-	// Since we only read in one block at a time, we have to create
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only read in one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */

This style of commenting is preferred only in the networking code. The
other parts of the kernel prefer this style:

/*
* bla
* bla
*/

WBR, Sergei

maintainer
#2 lore raw
In reply to Sunny Kumar
Quoted 31 lines · Sunny Kumar

This patch fixes checkpatch.pl warning c99 style commenting.

---
 drivers/usb/storage/sddr55.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/storage/sddr55.c +4 -5
index aacedef..54d0a59 100644
@@ -209,10 +209,10 @@ static int sddr55_read_data(struct us_data *us,
 	unsigned int len, offset;
 	struct scatterlist *sg;
 
-	// Since we only read in one block at a time, we have to create
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only read in one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */
 	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
 			info->smallpageshift) * PAGESIZE;
 	buffer = kmalloc(len, GFP_NOIO);
@@ -336,10 +336,10 @@ static int sddr55_write_data(struct us_data *us,
 		return USB_STOR_TRANSPORT_FAILED;
 	}
 
-	// Since we only write one block at a time, we have to create

drivers/usb/storage/sddr55.c static int sddr55_write_data(struct us_data *us, · line 345

Quoted 10 lines
drivers/usb/storage/sddr55.c +4 -3
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only write one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */
 	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
 			info->smallpageshift) * PAGESIZE;
 	buffer = kmalloc(len, GFP_NOIO);

Why did you fix just these two sites? There are lots of other places in usb-storage that use C99-style comments:

$ cd drivers/usb/storage
$ egrep '[^:]//' *.[ch] | wc
    177    1635    9562

(The [^:] is to avoid matching things like "http://", and as a result this misses the four places where a // comment starts at the beginning of a line.)

Why not fix all of them?

Alan Stern

#3 lore raw
Quoted 51 lines · Alan Stern
Quoted 31 lines · Sunny Kumar

This patch fixes checkpatch.pl warning c99 style commenting.

---
 drivers/usb/storage/sddr55.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/storage/sddr55.c +4 -5
index aacedef..54d0a59 100644
@@ -209,10 +209,10 @@ static int sddr55_read_data(struct us_data *us,
 	unsigned int len, offset;
 	struct scatterlist *sg;
 
-	// Since we only read in one block at a time, we have to create
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only read in one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */
 	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
 			info->smallpageshift) * PAGESIZE;
 	buffer = kmalloc(len, GFP_NOIO);
@@ -336,10 +336,10 @@ static int sddr55_write_data(struct us_data *us,
 		return USB_STOR_TRANSPORT_FAILED;
 	}
 
-	// Since we only write one block at a time, we have to create

drivers/usb/storage/sddr55.c static int sddr55_write_data(struct us_data *us, · line 345

Quoted 10 lines
drivers/usb/storage/sddr55.c +4 -3
-	// a bounce buffer and move the data a piece at a time between the
-	// bounce buffer and the actual transfer buffer.
-
+	/* Since we only write one block at a time, we have to create
+	 * a bounce buffer and move the data a piece at a time between the
+	 * bounce buffer and the actual transfer buffer.
+	 */
 	len = min((unsigned int) sectors, (unsigned int) info->blocksize >>
 			info->smallpageshift) * PAGESIZE;
 	buffer = kmalloc(len, GFP_NOIO);

Why did you fix just these two sites? There are lots of other places in usb-storage that use C99-style comments:

$ cd drivers/usb/storage
$ egrep '[^:]//' *.[ch] | wc
    177    1635    9562
Quoted 5 lines

(The [^:] is to avoid matching things like "http://", and as a result this misses the four places where a // comment starts at the beginning of a line.)

Why not fix all of them?

These were C99 muliline comments so thought of fixing ..

Quoted 3 lines

Alan Stern