qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for syscall tests
@ 2016-09-27 15:14 riku.voipio
  2016-09-27 17:02 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: riku.voipio @ 2016-09-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

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 <riku.voipio@linaro.org>
---
 scripts/checkpatch.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3afa19a..e17f445 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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);
 		}
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for syscall tests
  2016-09-27 15:14 [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for syscall tests riku.voipio
@ 2016-09-27 17:02 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-09-27 17:02 UTC (permalink / raw)
  To: riku.voipio, qemu-devel



On 27/09/2016 17:14, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
> 
> 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 <riku.voipio@linaro.org>
> ---
>  scripts/checkpatch.pl | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 3afa19a..e17f445 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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);
>  		}
>  
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-27 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27 15:14 [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for syscall tests riku.voipio
2016-09-27 17:02 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).