[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180418164804.GJ10061@sirena.org.uk>
Date: Wed, 18 Apr 2018 17:48:04 +0100
From: Mark Brown <broonie@...nel.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Javier Martinez Canillas <javier@...hile0.org>,
David Collins <collinsd@...eaurora.org>,
Evan Green <evgreen@...omium.org>, swboyd@...omium.org,
linux-omap <linux-omap@...r.kernel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Tony Lindgren <tony@...mide.com>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] regulator: Don't return or expect -errno from
of_map_mode()
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists