Thread (28 messages) 28 messages, 4 authors, 2018-07-06

Re: [PATCH v7 1/4] mfd: bd71837: mfd driver for ROHM BD71837 PMIC

From: Lee Jones <hidden>
Date: 2018-07-06 07:06:13
Also in: linux-clk, linux-input, lkml

On Thu, 05 Jul 2018, Dmitry Torokhov wrote:
On July 5, 2018 12:56:50 AM PDT, Matti Vaittinen [off-list ref] wrote:
quoted
On Wed, Jul 04, 2018 at 06:57:39PM +0200, Enric Balletbo Serra wrote:
quoted
Missatge de Dmitry Torokhov [off-list ref] del dia dc.,
4
quoted
de jul. 2018 a les 17:10:
quoted
Hi Enric,

On Tue, Jun 26, 2018 at 11:06:33AM +0200, Enric Balletbo Serra
wrote:
quoted
quoted
quoted
Hi Matti,

Thanks for the patch, a few comments below, some are feedback I
received when I sent some patches to this subsystem.

Missatge de Matti Vaittinen [off-list ref]
del
quoted
quoted
quoted
dia dt., 19 de juny 2018 a les 12:57:
quoted
+};
+
+/* bd71837 multi function cells */
+static struct mfd_cell bd71837_mfd_cells[] = {
+       {
+               .name = "bd71837-clk",
+       }, {
+               .name = "bd718xx-pwrkey",
+               .resources = &irqs[0],
+               .num_resources = ARRAY_SIZE(irqs),
+       }, {
+               .name = "bd71837-pmic",
+       },
nit: no comma at the end
Actually, trailing comma is preferred on structures/arrays without
sentinels, because if one needs to add a new entry/new member, then
in
quoted
quoted
the diff there will have only one new line added, instead of one
line
quoted
quoted
being changed (adding now necessary comma) and one added.
Many thanks for sharing your knowledge! That looks to me a good
reason.
So in this specific ecample leaving the comma does not help. The
opening
brace for new array element would be added to same line where the comma
is, right?
Ah, yes,  you are right. We usually have either:

        { /* element 1 */ },
        { / *element 2 */ },
        ...

or:

        {
                /* element 1 */
        },
        {
                /* element 2 */
        },

but I do not think that it is codified in the CodingStyle.
FWIW, my *strong* preference for single line entries in the
aforementioned single line format.  Then Dmitry's explanation rings
true.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help