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-Url: https://git.stricted.de/?a=commitdiff_plain;h=ece9659f16e369d344fe4325d87fab3bb50d1fe2;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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 9f14bf928cc7..da74e65064d1 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",