public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Marek Vasut <marek.vasut@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Mark Brown <broonie@kernel.org>,
	Steve Twiss <stwiss.opensource@diasemi.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v3 08/10] mfd: da9063: Register RTC only on DA9063L
Date: Thu, 7 Jun 2018 14:24:14 +0100	[thread overview]
Message-ID: <20180607132414.GF22841@dell> (raw)
In-Reply-To: <feeb19cc-e7df-1859-86b9-da99059d8e32@gmail.com>

On Thu, 07 Jun 2018, Marek Vasut wrote:

> On 06/07/2018 07:04 AM, Lee Jones wrote:
> > On Wed, 06 Jun 2018, Marek Vasut wrote:
> >> On 06/06/2018 08:16 AM, Lee Jones wrote:
> >>> On Tue, 05 Jun 2018, Marek Vasut wrote:
> >>
> >> [...]
> >>
> >>>>>> -static const struct mfd_cell da9063_devs[] = {
> >>>>>> +static const struct mfd_cell da9063_common_devs[] = {
> >>>>>>  	{
> >>>>>>  		.name		= DA9063_DRVNAME_REGULATORS,
> >>>>>
> >>>>> Appreciate that these are historical, but these device name defines
> >>>>> make me shudder.  They only serve to act as an obfuscation layer when
> >>>>> debugging at platform level.  Please consider getting rid of them.
> >>>>
> >>>> The macro can be shared between the core and the drivers, so the names
> >>>> never run out of sync.
> >>>
> >>> Platform driver name changes are vary rare.  Even if they are changed,
> >>> even light testing would uncover the fact that child drivers do not
> >>> .probe().
> >>
> >> Sure, while if the macro is used, this problem is avoided altogether.
> >>
> >>> Due to the current obfuscation, I currently have no idea
> >>> what this device's name is.
> >>
> >> I'm sure ctags or git grep can easily help.
> > 
> > I'm aware how to get around the 'issue', but it's an additional step
> > which is avoidable.  For me personally it comes from doing *a lot* of
> > platform level work and being irritated by the extra grepping.  Macros
> > for driver names does not sit right with me at all.  There are even
> > worse examples of people defining the MACROs *inside* the driver,
> > which doesn't even benefit from the small redeeming feature you
> > mention above.
> 
> If we follow this line of thinking, we could just run cpp and expand all
> macros. Then there's no need for grepping at all. That probably won't be
> the result anyone would like though.

Hmm ... yes, that's the same! :D

> > Anyway, I'm happy with you not wanting to change it.  Just leave them
> > as they are for now.
> >>>>>> +	{
> >>>>>> +		.name		= DA9063_DRVNAME_VIBRATION,
> >>>>>> +	},
> >>>>>
> >>>>> Place this on a single line please.
> >>>>
> >>>> This would only make the style inconsistent with the ie. LEDs entry.
> >>>>
> >>>>>         { .name	= DA9063_DRVNAME_VIBRATION },
> >>>
> >>> If that is a one line entry spaced over multiple lines, then that
> >>> should also be changed.
> >>>
> >>> Maybe I will go through and stylise this driver a bit after all (but
> >>> as time is short at the moment, maybe not!) :)
> >>
> >> You'd end up with two entries which look different then the rest, which
> >> triggers my OCD.
> > 
> > OCD or not, it's never okay to waste lines.  If ordering it not
> > important (which it should not be -- it's fragile to rely on device
> > ordering in MFD cells), the multi-line entries go at the top, followed
> > by the single line entries.  If done right, it looks the opposite of
> > bad/out of place.
> 
> My point is, the style should at least be consistent. But anyway.

It is consistent.

 - Multi-line entries go on multiple lines.
 - Single line entries go on single lines.

See drivers/mfd/max77620.c for how it should look.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2018-06-07 13:24 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02 10:11 [PATCH v3 01/10] mfd: da9063: Fix failpath in core Marek Vasut
2018-06-02 10:11 ` [PATCH v3 02/10] mfd: da9063: Use REGMAP_IRQ_REG Marek Vasut
2018-06-04  7:17   ` Geert Uytterhoeven
2018-06-04 12:26   ` Lee Jones
2018-06-04 16:23     ` Marek Vasut
2018-06-05  7:09       ` Lee Jones
2018-06-05  7:31         ` Geert Uytterhoeven
2018-06-05  8:16           ` Lee Jones
2018-06-05 19:48   ` Steve Twiss
2018-06-02 10:11 ` [PATCH v3 03/10] mfd: da9063: Rename PMIC_DA9063 to PMIC_CHIP_ID_DA9063 Marek Vasut
2018-06-04 12:26   ` Lee Jones
2018-06-04 18:31     ` Marek Vasut
2018-06-05  7:05       ` Lee Jones
2018-06-05 17:16       ` Steve Twiss
2018-06-05 17:20         ` Marek Vasut
2018-06-05 19:49   ` Steve Twiss
2018-06-02 10:11 ` [PATCH v3 04/10] mfd: da9063: Replace model with type Marek Vasut
2018-06-05  7:21   ` Lee Jones
2018-06-02 10:11 ` [PATCH v3 05/10] mfd: da9063: Add DA9063L type Marek Vasut
2018-06-05  7:22   ` Lee Jones
2018-06-05 19:50   ` Steve Twiss
2018-06-02 10:11 ` [PATCH v3 06/10] mfd: da9063: Add custom regmap for DA9063L Marek Vasut
2018-06-04  7:39   ` Geert Uytterhoeven
2018-06-04 16:25     ` Marek Vasut
2018-06-05 20:17       ` Steve Twiss
2018-06-05 23:02         ` Marek Vasut
2018-06-06  9:47           ` Steve Twiss
2018-06-06  9:50             ` Marek Vasut
2018-06-02 10:11 ` [PATCH v3 07/10] mfd: da9063: Add custom IRQ map " Marek Vasut
2018-06-05  7:47   ` Lee Jones
2018-06-05  7:54     ` Geert Uytterhoeven
2018-06-05  8:24       ` Lee Jones
2018-06-05 19:52   ` Steve Twiss
2018-06-05 22:58     ` Marek Vasut
2018-06-02 10:11 ` [PATCH v3 08/10] mfd: da9063: Register RTC only on DA9063L Marek Vasut
2018-06-05  7:53   ` Lee Jones
2018-06-05  9:29     ` Marek Vasut
2018-06-06  6:16       ` Lee Jones
2018-06-06  9:17         ` Marek Vasut
2018-06-07  5:04           ` Lee Jones
2018-06-07 10:57             ` Marek Vasut
2018-06-07 13:24               ` Lee Jones [this message]
2018-06-02 10:11 ` [PATCH v3 09/10] mfd: da9063: Handle less LDOs " Marek Vasut
2018-06-05  8:18   ` Lee Jones
2018-06-02 10:11 ` [PATCH v3 10/10] mfd: da9063: Add DA9063L support Marek Vasut
2018-06-05  8:18   ` Lee Jones
2018-06-05 19:47   ` Steve Twiss
2018-06-04  7:16 ` [PATCH v3 01/10] mfd: da9063: Fix failpath in core Geert Uytterhoeven
2018-06-04  8:28 ` Vaishali Thakkar
2018-06-04 12:24 ` Lee Jones
2018-06-04 13:08   ` Marek Vasut

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=20180607132414.GF22841@dell \
    --to=lee.jones@linaro.org \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=marek.vasut@gmail.com \
    --cc=stwiss.opensource@diasemi.com \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox