Skip to contentSkip to conversation

: sn9c20x.c: fix checkpatch error: that open brace { should be on the previous line

PATCH Superseded Morgan Phillips 2 participants 5 messages Sep 8, 2014 1 message not in the archive

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

PATCH 1/1 : sn9c20x.c: fix checkpatch error: that open brace { should be on the previous line

---
 drivers/media/usb/gspca/sn9c20x.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/usb/gspca/sn9c20x.c +6 -4
index 41a9a89..95467f0 100644
@@ -1787,8 +1787,9 @@ static int sd_init(struct gspca_dev *gspca_dev)
 	struct sd *sd = (struct sd *) gspca_dev;
 	int i;
 	u8 value;
-	u8 i2c_init[9] =
-		{0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
+	u8 i2c_init[9] = {
+		0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03
+	};
 
 	for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
 		value = bridge_init[i][1];
@@ -2242,8 +2243,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 	int avg_lum, is_jpeg;
-	static const u8 frame_header[] =
-		{0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
+	static const u8 frame_header[] = {
+		0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96
+	};
 
 	is_jpeg = (sd->fmt & 0x03) == 0;
 	if (len >= 64 && memcmp(data, frame_header, 6) == 0) {
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Morgan Phillips

no commit message ?

thanks
sudip

Quoted 40 lines
---
 drivers/media/usb/gspca/sn9c20x.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/usb/gspca/sn9c20x.c +6 -4
index 41a9a89..95467f0 100644
@@ -1787,8 +1787,9 @@ static int sd_init(struct gspca_dev *gspca_dev)
 	struct sd *sd = (struct sd *) gspca_dev;
 	int i;
 	u8 value;
-	u8 i2c_init[9] =
-		{0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
+	u8 i2c_init[9] = {
+		0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03
+	};
 
 	for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
 		value = bridge_init[i][1];
@@ -2242,8 +2243,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 	int avg_lum, is_jpeg;
-	static const u8 frame_header[] =
-		{0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
+	static const u8 frame_header[] = {
+		0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96
+	};
 
 	is_jpeg = (sd->fmt & 0x03) == 0;
 	if (len >= 64 && memcmp(data, frame_header, 6) == 0) {
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Morgan Reece

Hi Sudip,

I searched through the logs for examples of messages where people had just fixed checkpatch errors. I found lots like this, so went the format, ex:

Quoted 7 lines

commit 588a12d789e1a9b8193465c09f32024c0d43a849

Author: Filipe Gonçalves <[email protected]>
Date:   Fri Sep 5 05:09:46 2014 +0100

staging/lustre: Fixed checkpatch warning: Use #include <linux/statfs.h>
instead of <asm/statfs.h>

this is the commit log.
whatever you write above your Signed-off-by goes as the commit log. ideally commit log should have the full details of the change you have done , and the reason behind the change.
Incidentally , if you see all mails of today , you will find one of my patch as rejected because my commit log was not explanatory.

thanks
sudip

Quoted 61 lines
Quoted 54 lines · Sudip Mukherjee
Quoted 1 line · Morgan Phillips

no commit message ?

thanks
sudip

Review

Quoted 5 lines
---
 drivers/media/usb/gspca/sn9c20x.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/media/usb/gspca/sn9c20x.c

drivers/media/usb/gspca/sn9c20x.c static int sd_init(struct gspca_dev *gspca_dev) · line 1791

Quoted 9 lines

index 41a9a89..95467f0 100644

drivers/media/usb/gspca/sn9c20x.c +0 -2
@@ -1787,8 +1787,9 @@ static int sd_init(struct gspca_dev *gspca_dev)
      struct sd *sd = (struct sd *) gspca_dev;
      int i;
      u8 value;
-     u8 i2c_init[9] =
-             {0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x03};

drivers/media/usb/gspca/sn9c20x.c static int sd_init(struct gspca_dev *gspca_dev) · line 1791

Quoted 2 lines
drivers/media/usb/gspca/sn9c20x.c +2 -0
+     u8 i2c_init[9] = {
+             0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x03

drivers/media/usb/gspca/sn9c20x.c static void sd_pkt_scan(struct gspca_dev

Quoted 5 lines
drivers/media/usb/gspca/sn9c20x.c +1 -0
+     };
 
      for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
              value = bridge_init[i][1];
@@ -2242,8 +2243,9 @@ static void sd_pkt_scan(struct gspca_dev

*gspca_dev,

Quoted 14 lines
drivers/media/usb/gspca/sn9c20x.c +3 -3
 {
      struct sd *sd = (struct sd *) gspca_dev;
      int avg_lum, is_jpeg;
-     static const u8 frame_header[] =
-             {0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
+     static const u8 frame_header[] = {
+             0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96
+     };
 
      is_jpeg = (sd->fmt & 0x03) == 0;
      if (len >= 64 && memcmp(data, frame_header, 6) == 0) {
--

1.9.1

Quoted 2 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel"

in

Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw

PATCH v2 1/1 : sn9c20x.c: fix checkpatch error: that open brace { should be on the previous line

In reply to Morgan Phillips

Change array initialization format to fix style error.

	from:
		u8 foo[] =
			{1, 2, 3};
	to:
		u8 foo[] = {
			1, 2, 3
		};

---
Changes since v2:
* adds a more verbose commit message

 drivers/media/usb/gspca/sn9c20x.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/usb/gspca/sn9c20x.c +6 -4
index 41a9a89..95467f0 100644
@@ -1787,8 +1787,9 @@ static int sd_init(struct gspca_dev *gspca_dev)
 	struct sd *sd = (struct sd *) gspca_dev;
 	int i;
 	u8 value;
-	u8 i2c_init[9] =
-		{0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
+	u8 i2c_init[9] = {
+		0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03
+	};
 
 	for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
 		value = bridge_init[i][1];
@@ -2242,8 +2243,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 	int avg_lum, is_jpeg;
-	static const u8 frame_header[] =
-		{0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
+	static const u8 frame_header[] = {
+		0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96
+	};
 
 	is_jpeg = (sd->fmt & 0x03) == 0;
 	if (len >= 64 && memcmp(data, frame_header, 6) == 0) {
Signature · 1 line
1.9.1
#5 lore raw
Quoted 5 lines · Morgan Phillips

Change array initialization format to fix style error.

	from:
		u8 foo[] =
			{1, 2, 3};
	to:

checkpatch is giving a warning here , but looks like a false positive.

thanks
sudip

Quoted 48 lines
		u8 foo[] = {
			1, 2, 3
		};

---
Changes since v2:
* adds a more verbose commit message

 drivers/media/usb/gspca/sn9c20x.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/usb/gspca/sn9c20x.c +6 -4
index 41a9a89..95467f0 100644
@@ -1787,8 +1787,9 @@ static int sd_init(struct gspca_dev *gspca_dev)
 	struct sd *sd = (struct sd *) gspca_dev;
 	int i;
 	u8 value;
-	u8 i2c_init[9] =
-		{0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
+	u8 i2c_init[9] = {
+		0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03
+	};
 
 	for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
 		value = bridge_init[i][1];
@@ -2242,8 +2243,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 	int avg_lum, is_jpeg;
-	static const u8 frame_header[] =
-		{0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
+	static const u8 frame_header[] = {
+		0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96
+	};
 
 	is_jpeg = (sd->fmt & 0x03) == 0;
 	if (len >= 64 && memcmp(data, frame_header, 6) == 0) {
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/