Skip to content

Commit 263afd3

Browse files
cdowntorvalds
authored andcommitted
checkpatch: don't warn about colon termination in linker scripts
This check erroneously flags cases like the one in my recent printk enumeration patch[0], where the spaces are syntactic, and `section:' vs. `section :' is syntactically important: ERROR: space prohibited before that ':' (ctx:WxW) #258: FILE: include/asm-generic/vmlinux.lds.h:314: + .printk_fmts : AT(ADDR(.printk_fmts) - LOAD_OFFSET) { 0: https://lore.kernel.org/patchwork/patch/1375749/ Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Chris Down <[email protected]> Acked-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 58f0226 commit 263afd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5044,7 +5044,7 @@ sub process {
50445044
# A colon needs no spaces before when it is
50455045
# terminating a case value or a label.
50465046
} elsif ($opv eq ':C' || $opv eq ':L') {
5047-
if ($ctx =~ /Wx./) {
5047+
if ($ctx =~ /Wx./ and $realfile !~ m@.*\.lds\.h$@) {
50485048
if (ERROR("SPACING",
50495049
"space prohibited before that '$op' $at\n" . $hereptr)) {
50505050
$good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]);

0 commit comments

Comments
 (0)