Skip to contentSkip to conversation

pinctrl: Put space between type and data in compound literal

PATCH In review Andy Shevchenko 3 participants 3 messages Nov 9, 2022 – Nov 10, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 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.

---

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(-)
include/linux/pinctrl/pinctrl.h +1 -1
index 487117ccb1bc..f6ff2590657d 100644
@@ -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,			\
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Andy Shevchenko

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

---

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(-)
include/linux/pinctrl/pinctrl.h +0 -0
index 487117ccb1bc..f6ff2590657d 100644

include/linux/pinctrl/pinctrl.h struct pingroup { · line 46

Quoted 8 lines
include/linux/pinctrl/pinctrl.h +1 -1
@@ -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

Thanks,
--
Basavaraj