qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for linux-user
Date: Tue, 27 Sep 2016 02:36:34 +0300	[thread overview]
Message-ID: <CAAqcGHnCx2m--_t-ppO_ao5P-V7vvB16YyA8Ar=j7Uqi0Bi_+A@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-iY8qP3JSn7xbaiszitUWk2JOu4Q+nnACPT6qY-NM2Dg@mail.gmail.com>

On 27 September 2016 at 00:08, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 26 September 2016 at 12:58,  <riku.voipio@linaro.org> wrote:
>> From: Riku Voipio <riku.voipio@linaro.org>
>>
>> Linux-user and bsd-user code needs lots of arch-specific ifdefs,
>> so disable the warning.
>>
>> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
>> ---
>>  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.

One example from your patch:

https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg05650.html

And another from Laurent:

https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg06486.html

Every new syscall will comes with "#ifdef TARGET_NR_foo and
defined(__NR_foo)", while host/target combos catch up. Now, most
TARGET_NR_foo's are needed only for unicore32, but the __NR_foo
defines will be needed for a very long time.

Riku

  reply	other threads:[~2016-09-26 23:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 19:58 [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for linux-user riku.voipio
2016-09-26 20:03 ` no-reply
2016-09-26 21:08 ` Peter Maydell
2016-09-26 23:36   ` Riku Voipio [this message]
2016-09-27  0:21     ` Peter Maydell
2016-09-27 11:58 ` Paolo Bonzini
2016-09-27 13:36   ` Riku Voipio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAqcGHnCx2m--_t-ppO_ao5P-V7vvB16YyA8Ar=j7Uqi0Bi_+A@mail.gmail.com' \
    --to=riku.voipio@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).