2022-11-09 15:51:19

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 1/1] pinctrl: Put space between type and data in compound literal

It's slightly better to read when compound literal data and type
are separated by a space.

Signed-off-by: Andy Shevchenko <[email protected]>
---

It also standard practice in the kernel:

$ git grep -l '(struct [^()]\+) {' | wc -l
1384

$ git grep -l '(struct [^()]\+){' | wc -l
306

include/linux/pinctrl/pinctrl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 487117ccb1bc..f6ff2590657d 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -40,7 +40,7 @@ struct pingroup {

/* Convenience macro to define a single named or anonymous pingroup */
#define PINCTRL_PINGROUP(_name, _pins, _npins) \
-(struct pingroup){ \
+(struct pingroup) { \
.name = _name, \
.pins = _pins, \
.npins = _npins, \
--
2.35.1



2022-11-09 16:34:21

by Basavaraj Natikar

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] pinctrl: Put space between type and data in compound literal



On 11/9/2022 8:53 PM, Andy Shevchenko wrote:
> It's slightly better to read when compound literal data and type
> are separated by a space.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
> ---
>
> It also standard practice in the kernel:
>
> $ git grep -l '(struct [^()]\+) {' | wc -l
> 1384
>
> $ git grep -l '(struct [^()]\+){' | wc -l
> 306
>
> include/linux/pinctrl/pinctrl.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
> index 487117ccb1bc..f6ff2590657d 100644
> --- a/include/linux/pinctrl/pinctrl.h
> +++ b/include/linux/pinctrl/pinctrl.h
> @@ -40,7 +40,7 @@ struct pingroup {
>
> /* Convenience macro to define a single named or anonymous pingroup */
> #define PINCTRL_PINGROUP(_name, _pins, _npins) \
> -(struct pingroup){ \
> +(struct pingroup) { \
> .name = _name, \
> .pins = _pins, \
> .npins = _npins, \

Looks good to me

Reviewed-by: Basavaraj Natikar <[email protected]>

Thanks,
--
Basavaraj


2022-11-10 10:35:18

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] pinctrl: Put space between type and data in compound literal

On Wed, Nov 9, 2022 at 4:23 PM Andy Shevchenko
<[email protected]> wrote:

> It's slightly better to read when compound literal data and type
> are separated by a space.
>
> Signed-off-by: Andy Shevchenko <[email protected]>

Patch applied.

Yours,
Linus Walleij