From: Dan Carpenter Date: Wed, 6 Aug 2014 23:11:29 +0000 (-0700) Subject: checkpatch: warn on missing spaces in broken up quoted X-Git-Tag: v4.9.8~5947^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ece9659f16e369d344fe4325d87fab3bb50d1fe2;p=platform%2Fkernel%2Flinux-rpi3.git checkpatch: warn on missing spaces in broken up quoted Checkpatch already complains when people break up quoted strings but it's still pretty common. One mistake that people often make is they leave out the space character between the two strings. This check adds around 450 new warnings and has a low rate of false positives. Signed-off-by: Dan Carpenter Cc: Andy Whitcroft Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9f14bf9..da74e65 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2361,6 +2361,12 @@ sub process { "quoted string split across lines\n" . $hereprev); } +# check for missing a space in a string concatination + if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) { + WARN('MISSING_SPACE', + "break quoted strings at a space character\n" . $hereprev); + } + # check for spaces before a quoted newline if ($rawline =~ /^.*\".*\s\\n/) { if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE",