From: Peter Maydell <peter.maydell@linaro.org>
To: Riku Voipio <riku.voipio@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for linux-user
Date: Mon, 26 Sep 2016 14:08:43 -0700 [thread overview]
Message-ID: <CAFEAcA-iY8qP3JSn7xbaiszitUWk2JOu4Q+nnACPT6qY-NM2Dg@mail.gmail.com> (raw)
In-Reply-To: <1474919934-21518-1-git-send-email-riku.voipio@linaro.org>
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.
thanks
-- PMM
next prev parent reply other threads:[~2016-09-26 21:09 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 [this message]
2016-09-26 23:36 ` Riku Voipio
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=CAFEAcA-iY8qP3JSn7xbaiszitUWk2JOu4Q+nnACPT6qY-NM2Dg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@linaro.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).