All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Doug Evans <dje@google.com>
Cc: Hao Wu <wuhaotsh@google.com>, Jason Wang <jasowang@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Avi Fishman <avi.fishman@nuvoton.com>
Subject: Re: [PATCH v2 1/3] hw/net: Add npcm7xx emc model
Date: Tue, 9 Feb 2021 09:44:16 +0000	[thread overview]
Message-ID: <CAFEAcA_mE_ixAmcYrtb_H=S8BNXU+nTqO6T2+iJLJ8wfk9hRQQ@mail.gmail.com> (raw)
In-Reply-To: <CADPb22T69j7TahUr8OhmVv4ZQQyJxSvQ1qm1aDm_SpR2nuRr6w@mail.gmail.com>

On Tue, 9 Feb 2021 at 01:26, Doug Evans <dje@google.com> wrote:
> On Mon, Feb 8, 2021 at 9:17 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>> Don't put local variable declarations in the middle of functions,
>> please. Coding style says they should be at the start of a
>> block (so, here, the start of the function). It looks like you've
>> got middle-of-function declarations in several places in other
>> functions too, so could you fix them all up please?
>
>
> Fixed in v3.
> Maybe now's a good time though to revisit this rule.
> QEMU uses C99, and mixed decls/statements is an easy improvement to the coding standards.
> I'm guessing this is an uncontroversial request. Is there just inertia behind not making the change thus far?

My personal opinion is that having declarations in the
middle of functions is uglier. CODING_STYLE.rst already
notes that we have an occasional-exception if there are
#ifdefs involved, so we don't have the style rule because
we're trying to work with compilers that don't accept
middle-of-block declarations.

thanks
-- PMM


  reply	other threads:[~2021-02-09  9:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 23:28 [PATCH v2 0/3] Add npcm7xx emc model dje--- via
2021-02-02 23:28 ` [PATCH v2 1/3] hw/net: " dje--- via
2021-02-08 17:17   ` Peter Maydell
2021-02-09  1:25     ` Doug Evans
2021-02-09  9:44       ` Peter Maydell [this message]
2021-02-02 23:28 ` [PATCH v2 2/3] hw/arm: " dje--- via
2021-02-08 17:20   ` Peter Maydell
2021-02-02 23:28 ` [PATCH v2 3/3] tests/qtests: Add npcm7xx emc model test dje--- via
2021-02-08 17:21   ` Peter Maydell

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_mE_ixAmcYrtb_H=S8BNXU+nTqO6T2+iJLJ8wfk9hRQQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=avi.fishman@nuvoton.com \
    --cc=dje@google.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wuhaotsh@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.