checkpatch: require quotes around section name in the __section() macro
authorMarek Behún <marek.behun@nic.cz>
Thu, 20 May 2021 11:23:51 +0000 (13:23 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 24 May 2021 18:21:30 +0000 (14:21 -0400)
This is how Linux does this now, see Linux commit 339f29d91acf.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
scripts/checkpatch.pl

index 59a714a..08a8275 100755 (executable)
@@ -6073,7 +6073,7 @@ sub process {
                        my $old = substr($rawline, $-[1], $+[1] - $-[1]);
                        my $new = substr($old, 1, -1);
                        if (WARN("PREFER_SECTION",
-                                "__section($new) is preferred over __attribute__((section($old)))\n" . $herecurr) &&
+                                "__section(\"$new\") is preferred over __attribute__((section($old)))\n" . $herecurr) &&
                            $fix) {
                                $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*_*section_*\s*\(\s*\Q$old\E\s*\)\s*\)\s*\)/__section($new)/;
                        }