From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bod9D-0003ew-2P for qemu-devel@nongnu.org; Mon, 26 Sep 2016 17:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bod96-0002YK-VM for qemu-devel@nongnu.org; Mon, 26 Sep 2016 17:09:09 -0400 Received: from mail-ua0-x229.google.com ([2607:f8b0:400c:c08::229]:34780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bod96-0002XY-PV for qemu-devel@nongnu.org; Mon, 26 Sep 2016 17:09:04 -0400 Received: by mail-ua0-x229.google.com with SMTP id u68so2071111uau.1 for ; Mon, 26 Sep 2016 14:09:04 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1474919934-21518-1-git-send-email-riku.voipio@linaro.org> References: <1474919934-21518-1-git-send-email-riku.voipio@linaro.org> From: Peter Maydell Date: Mon, 26 Sep 2016 14:08:43 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for linux-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: QEMU Developers On 26 September 2016 at 12:58, wrote: > From: Riku Voipio > > Linux-user and bsd-user code needs lots of arch-specific ifdefs, > so disable the warning. > > Signed-off-by: Riku Voipio > --- > scripts/checkpatch.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index dde3f5f..98a007f 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2405,8 +2405,9 @@ 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. Skip test on linux-user and bsd-user > +# where arch defines are needed > + if (!($realfile =~ /^(linux|bsd)-user/) && $line =~ m@^.\s*\#\s*if.*\b__@) { > ERROR("architecture specific defines should be avoided\n" . $herecurr); > } Do you have some examples of the false positives you want to suppress here? For new code I would hope that we can handle host-arch-specifics by having new files (or just new #defines etc) in linux-user/host/$ARCH/ rather than inline #ifdeffery in the main files. thanks -- PMM