qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, Stefan Weil <sw@weilnetz.de>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Blue Swirl <blauwirbel@gmail.com>,
	Don Slutz <Don@cloudswitch.com>,
	Markus Armbruster <armbru@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] checkpatch.pl question
Date: Sun, 08 Jun 2014 10:32:19 +0200	[thread overview]
Message-ID: <53941F93.2000408@redhat.com> (raw)
In-Reply-To: <CAFEAcA9XOSiYouQt--sivLohsEJn38WDLEk7+svbcQVMT=SXzw@mail.gmail.com>

Il 07/06/2014 18:27, Peter Maydell ha scritto:
> On 7 June 2014 17:00, Stefan Weil <sw@weilnetz.de> wrote:
>> Am 07.06.2014 16:58, schrieb Peter Maydell:
>>> It's clearly something to do with it getting confused by the type name,
>>> because you can suppress the warning by just changing it so it has
>>> an "_t" suffix, for instance. In particular notice that the set of allowed
>>> type names constructed by the build_types() subroutine is extremely
>>> limited: it looks to me as if the script makes assumptions based on
>>> kernel style (where 'struct foo' is preferred over a typedef and plain
>>> 'foo') that allow it to assume that if it's not one of a very few allowed
>>> formats then it's not a type name.
>
>> Yes, but that's only part of the story. checkpatch.pl contains some
>> special handling for the standard C data types and also knows some Linux
>> data type patterns. It also handles the above case correctly in most
>> circumstances because there is special code for "*" used in function
>> argument lists.
>
> Interesting. There are obviously multiple situations where it
> fails in this way for different reasons. This is the case I saw yesterday:
>
> @@ -125,19 +125,20 @@ static TCGRegSet tcg_target_available_regs[2];
>  static TCGRegSet tcg_target_call_clobber_regs;
>
>  #if TCG_TARGET_INSN_UNIT_SIZE == 1
> -static inline void tcg_out8(TCGContext *s, uint8_t v)
> +static __attribute__((unused)) inline void tcg_out8(TCGContext *s, uint8_t v)
>  {
>      *s->code_ptr++ = v;
>  }
>
> No macros or previous context for it to get confused by.
> Saying "TCGContext_t" instead silences the warning.

Given QEMU's coding style, any camelcase identifier (or equivalently and 
identifier containing an uppercase and a lowercase letter) could be 
considered a type.

Paolo

      reply	other threads:[~2014-06-08  8:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06  3:37 [Qemu-devel] checkpatch.pl question Alexey Kardashevskiy
2014-06-06  6:27 ` Markus Armbruster
2014-06-06  6:33   ` Alexey Kardashevskiy
2014-06-06  7:17     ` Markus Armbruster
2014-06-07 14:58       ` Peter Maydell
2014-06-07 16:00         ` Stefan Weil
2014-06-07 16:27           ` Peter Maydell
2014-06-08  8:32             ` Paolo Bonzini [this message]

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=53941F93.2000408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Don@cloudswitch.com \
    --cc=aik@ozlabs.ru \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).