瀏覽代碼

checkpatch: format strings should not have brackets in macros

We should not recommend braces for the following:

    #define pr_fmt(fmt)    "%s: " fmt, __func__

allow things with double quotes round them to avoid this check.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Whitcroft 15 年之前
父節點
當前提交
ea71a0a019
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      scripts/checkpatch.pl

+ 2 - 1
scripts/checkpatch.pl

@@ -2288,7 +2288,8 @@ sub process {
 				DECLARE_PER_CPU|
 				DECLARE_PER_CPU|
 				DEFINE_PER_CPU|
 				DEFINE_PER_CPU|
 				__typeof__\(|
 				__typeof__\(|
-				\.$Ident\s*=\s*
+				\.$Ident\s*=\s*|
+				^\"|\"$
 			}x;
 			}x;
 			#print "REST<$rest> dstat<$dstat>\n";
 			#print "REST<$rest> dstat<$dstat>\n";
 			if ($rest ne '') {
 			if ($rest ne '') {