Skip to contentSkip to conversation

BUG: checkpatch

PATCH Jaswinder Singh 2 participants 2 messages Aug 18, 2008 – Aug 26, 2008

lore
Share & tools
lore
#0 lore raw

[jsr@jaswinder jaswinder-git]$ cat test.c
void test(int i, int j, int k)

{
	printk(KERN_INFO "/* Testing i, j, k */\n");
	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
}

[jsr@jaswinder jaswinder-git]$ ./linux-2.6/scripts/checkpatch.pl --file test.c
ERROR: spaces required around that ':' (ctx:VxW)
#4: FILE: test.c:4:
+ printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
^

ERROR: need consistent spacing around '%' (ctx:WxV) #4: FILE: test.c:4:
+ printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
^

ERROR: spaces required around that ':' (ctx:VxW)
#4: FILE: test.c:4:
+ printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
^

ERROR: need consistent spacing around '%' (ctx:WxV) #4: FILE: test.c:4:
+ printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
^

ERROR: spaces required around that ':' (ctx:VxO)
#4: FILE: test.c:4:
+ printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
^

total: 5 errors, 0 warnings, 5 lines checked

test.c has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
[jsr@jaswinder jaswinder-git]$ cat test_working.c
void test(int i, int j, int k)

{
	printk(KERN_INFO "/* Testing i, j, k * /\n");
	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
}

[jsr@jaswinder jaswinder-git]$ ./linux-2.6/scripts/checkpatch.pl --file test_working.c
total: 0 errors, 0 warnings, 5 lines checked

test_working.c has no obvious style problems and is ready for submission. [jsr@jaswinder jaswinder-git]$ diff -uN test.c test_working.c

test_working.c renamed from test.c +1 -1
@@ -1,5 +1,5 @@
 void test(int i, int j, int k)
 {
-	printk(KERN_INFO "/* Testing i, j, k */\n");
+	printk(KERN_INFO "/* Testing i, j, k * /\n");
 	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 }

[jsr@jaswinder jaswinder-git]$ cp test.c test
[jsr@jaswinder jaswinder-git]$ ./linux-2.6/scripts/checkpatch.pl --file test
total: 0 errors, 0 warnings, 5 lines checked

test has no obvious style problems and is ready for submission. [jsr@jaswinder jaswinder-git]$

#1 lore raw
Quoted 61 lines · Jaswinder Singh

[jsr@jaswinder jaswinder-git]$ cat test.c
void test(int i, int j, int k)

{
	printk(KERN_INFO "/* Testing i, j, k */\n");
	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
}

[jsr@jaswinder jaswinder-git]$ ./linux-2.6/scripts/checkpatch.pl --file test.c
ERROR: spaces required around that ':' (ctx:VxW)
#4: FILE: test.c:4:

(quoted diff) +1 -0
+	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 	                   ^

ERROR: need consistent spacing around '%' (ctx:WxV) #4: FILE: test.c:4:

(quoted diff) +1 -0
+	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 	                     ^

ERROR: spaces required around that ':' (ctx:VxW)
#4: FILE: test.c:4:

(quoted diff) +1 -0
+	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 	                         ^

ERROR: need consistent spacing around '%' (ctx:WxV) #4: FILE: test.c:4:

(quoted diff) +1 -0
+	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 	                           ^

ERROR: spaces required around that ':' (ctx:VxO)
#4: FILE: test.c:4:

(quoted diff) +1 -0
+	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 	                               ^

total: 5 errors, 0 warnings, 5 lines checked

test.c has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
[jsr@jaswinder jaswinder-git]$ cat test_working.c
void test(int i, int j, int k)

{
	printk(KERN_INFO "/* Testing i, j, k * /\n");
	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
}

[jsr@jaswinder jaswinder-git]$ ./linux-2.6/scripts/checkpatch.pl --file test_working.c
total: 0 errors, 0 warnings, 5 lines checked

test_working.c has no obvious style problems and is ready for submission. [jsr@jaswinder jaswinder-git]$ diff -uN test.c test_working.c

test_working.c renamed from test.c +1 -1
@@ -1,5 +1,5 @@
 void test(int i, int j, int k)
 {
-	printk(KERN_INFO "/* Testing i, j, k */\n");
+	printk(KERN_INFO "/* Testing i, j, k * /\n");
 	printk(KERN_INFO "i: %d j: %d k:%d\n", i, j, k);
 }

[jsr@jaswinder jaswinder-git]$ cp test.c test
[jsr@jaswinder jaswinder-git]$ ./linux-2.6/scripts/checkpatch.pl --file test
total: 0 errors, 0 warnings, 5 lines checked

Quoted 2 lines

test has no obvious style problems and is ready for submission. [jsr@jaswinder jaswinder-git]$

Bah, a trivial bug in the comments/quote matcher leading to the apparent close comment taking effect when quoted. Should be fixed in my next batch of updates to akpm (0.23).

-apw