From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bovll-0008AW-Ii for qemu-devel@nongnu.org; Tue, 27 Sep 2016 13:02:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bovlh-0004LQ-PH for qemu-devel@nongnu.org; Tue, 27 Sep 2016 13:02:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bovlh-0004LE-Io for qemu-devel@nongnu.org; Tue, 27 Sep 2016 13:02:09 -0400 References: <1474989265-30733-1-git-send-email-riku.voipio@linaro.org> From: Paolo Bonzini Message-ID: Date: Tue, 27 Sep 2016 19:02:06 +0200 MIME-Version: 1.0 In-Reply-To: <1474989265-30733-1-git-send-email-riku.voipio@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for syscall tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: riku.voipio@linaro.org, qemu-devel@nongnu.org On 27/09/2016 17:14, riku.voipio@linaro.org wrote: > From: Riku Voipio > > 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 > --- > 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