All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Javier Martinez Canillas <javier@dowhile0.org>,
	David Collins <collinsd@codeaurora.org>,
	Evan Green <evgreen@chromium.org>,
	swboyd@chromium.org, linux-omap <linux-omap@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Tony Lindgren <tony@atomide.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] regulator: Don't return or expect -errno from of_map_mode()
Date: Wed, 18 Apr 2018 17:48:04 +0100	[thread overview]
Message-ID: <20180418164804.GJ10061@sirena.org.uk> (raw)
In-Reply-To: <CAD=FV=U2_G=6yPndd0Fdd=e0zoM6x+h0Zqqyt6qcWx3TDohSdg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

On Wed, Apr 18, 2018 at 08:56:22AM -0700, Doug Anderson wrote:
> On Wed, Apr 18, 2018 at 12:15 AM, Javier Martinez Canillas

> >>         if (!of_property_read_u32(np, "regulator-initial-mode", &pval)) {
> >>                 if (desc && desc->of_map_mode) {
> >> -                       ret = desc->of_map_mode(pval);
> >> -                       if (ret == -EINVAL)
> >> +                       unsigned int mode = desc->of_map_mode(pval);

> > I think the convention is to always declare local variables at the
> > start of the function? Although I couldn't find anything in the coding
> > style document...

> I haven't seen this as a consistent kernel convention.  It seems a bit
> up to the subsystem and/or driver maintainer.  However, I'm happy to
> put it up at the top if it makes people happy.

It's *fairly* consistent (this is C code after all) - doing something
different usually has some form of motivation.  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2018-04-18 16:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  3:31 [PATCH v2] regulator: Don't return or expect -errno from of_map_mode() Douglas Anderson
2018-04-18  7:15 ` Javier Martinez Canillas
2018-04-18 15:56   ` Doug Anderson
2018-04-18 16:48     ` Mark Brown [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=20180418164804.GJ10061@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=collinsd@codeaurora.org \
    --cc=dianders@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=javier@dowhile0.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=swboyd@chromium.org \
    --cc=tony@atomide.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.