diff mbox series

[u-boot,v4,02/36] checkpatch: require quotes around section name in the __section() macro

Message ID 20210520112425.25166-3-marek.behun@nic.cz
State Accepted
Commit 9ce799aaba104a1f0d36bf84caec4c807fa31baa
Delegated to: Tom Rini
Headers show
Series U-Boot LTO (Sandbox + Some ARM boards) | expand

Commit Message

Marek Behún May 20, 2021, 11:23 a.m. UTC
This is how Linux does this now, see Linux commit 339f29d91acf.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass May 20, 2021, 5:51 p.m. UTC | #1
On Thu, 20 May 2021 at 05:25, Marek Behún <marek.behun@nic.cz> wrote:
>
> This is how Linux does this now, see Linux commit 339f29d91acf.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini May 25, 2021, 12:54 a.m. UTC | #2
On Thu, May 20, 2021 at 01:23:51PM +0200, Marek Behún wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 59a714a95f..08a827535a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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)/;
 			}