checkpatch.pl: disable arch-specific test for syscall tests
PATCH 1/1 checkpatch.pl: disable arch-specific test for syscall tests
From: Riku Voipio <[email protected]>
Linux-user and bsd-user code need ifdef guards for new system calls that aren't implemented on all host/target combinations. Allow ifdefs for system calls when defined as __NR_foo.
Signed-off-by Riku Voipio <[email protected]>
--- scripts/checkpatch.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +4 -2
@@ -2405,8 +2405,10 @@ sub process { } # check of hardware specific defines # we have e.g. CONFIG_LINUX and CONFIG_WIN32 for common cases -# where they might be necessary. - if ($line =~ m@^.\s*\#\s*if.*\b__@) { +# where they might be necessary. Ignore __NR and __TARGET_NR +# definitions that are needed for linux-user builds + if (($line =~ m@^.\s*\#\s*if.*\b__@) && + !($realfile =~ /^(linux|bsd)-user/ && $line =~ /__NR_/)) { WARN("architecture specific defines should be avoided\n" . $herecurr); }
Signature · 1 line
2.1.4
Quoted 19 lines · On 27/09/2016 17:14, [email protected] wrote:
From: Riku Voipio <[email protected]>
Linux-user and bsd-user code need ifdef guards for new system calls that aren't implemented on all host/target combinations. Allow ifdefs for system calls when defined as
__NR_foo.Signed-off-by Riku Voipio <[email protected]>--- scripts/checkpatch.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)scripts/checkpatch.pl +0
-0@@ -2405,8 +2405,10 @@ sub process { } # check of hardware specific defines
scripts/checkpatch.pl sub process { · line 2414
Quoted 10 lines
scripts/checkpatch.pl +4
-2# we have e.g. CONFIG_LINUX and CONFIG_WIN32 for common cases -# where they might be necessary. - if ($line =~ m@^.\s*\#\s*if.*\b__@) { +# where they might be necessary. Ignore __NR and __TARGET_NR +# definitions that are needed for linux-user builds + if (($line =~ m@^.\s*\#\s*if.*\b__@) && + !($realfile =~ /^(linux|bsd)-user/ && $line =~ /__NR_/)) { WARN("architecture specific defines should be avoided\n" . $herecurr); }
Acked-by Paolo Bonzini <[email protected]>