2019-10-05 21:01:32

by Gabriela Bittencourt

[permalink] [raw]
Subject: [PATCH] staging: greybus: add blank line after declarations

Fix CHECK: add blank line after declarations

Signed-off-by: Gabriela Bittencourt <[email protected]>
---
drivers/staging/greybus/control.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/greybus/control.h b/drivers/staging/greybus/control.h
index 3a29ec05f631..5a45d55349a1 100644
--- a/drivers/staging/greybus/control.h
+++ b/drivers/staging/greybus/control.h
@@ -24,6 +24,7 @@ struct gb_control {
char *vendor_string;
char *product_string;
};
+
#define to_gb_control(d) container_of(d, struct gb_control, dev)

struct gb_control *gb_control_create(struct gb_interface *intf);
--
2.20.1


2019-10-06 09:51:18

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: greybus: add blank line after declarations

On Sat, Oct 05, 2019 at 06:00:46PM -0300, Gabriela Bittencourt wrote:
> Fix CHECK: add blank line after declarations
>
> Signed-off-by: Gabriela Bittencourt <[email protected]>
> ---
> drivers/staging/greybus/control.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/greybus/control.h b/drivers/staging/greybus/control.h
> index 3a29ec05f631..5a45d55349a1 100644
> --- a/drivers/staging/greybus/control.h
> +++ b/drivers/staging/greybus/control.h
> @@ -24,6 +24,7 @@ struct gb_control {
> char *vendor_string;
> char *product_string;
> };
> +
> #define to_gb_control(d) container_of(d, struct gb_control, dev)

No, the original code is "better" here, it's a common pattern despite
what checkpatch.pl tells you, sorry.

thanks,

greg k-h

2019-10-06 10:10:59

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] staging: greybus: add blank line after declarations

On Sun, 2019-10-06 at 11:50 +0200, Greg KH wrote:
> On Sat, Oct 05, 2019 at 06:00:46PM -0300, Gabriela Bittencourt wrote:
> > Fix CHECK: add blank line after declarations
[]
> > diff --git a/drivers/staging/greybus/control.h b/drivers/staging/greybus/control.h
[]
> > @@ -24,6 +24,7 @@ struct gb_control {
> > char *vendor_string;
> > char *product_string;
> > };
> > +
> > #define to_gb_control(d) container_of(d, struct gb_control, dev)
>
> No, the original code is "better" here, it's a common pattern despite
> what checkpatch.pl tells you, sorry.

Statistics please.

I believe it's not a common pattern.


2019-10-06 11:26:57

by Julia Lawall

[permalink] [raw]
Subject: Re: [Outreachy kernel] Re: [PATCH] staging: greybus: add blank line after declarations



On Sun, 6 Oct 2019, Joe Perches wrote:

> On Sun, 2019-10-06 at 11:50 +0200, Greg KH wrote:
> > On Sat, Oct 05, 2019 at 06:00:46PM -0300, Gabriela Bittencourt wrote:
> > > Fix CHECK: add blank line after declarations
> []
> > > diff --git a/drivers/staging/greybus/control.h b/drivers/staging/greybus/control.h
> []
> > > @@ -24,6 +24,7 @@ struct gb_control {
> > > char *vendor_string;
> > > char *product_string;
> > > };
> > > +
> > > #define to_gb_control(d) container_of(d, struct gb_control, dev)
> >
> > No, the original code is "better" here, it's a common pattern despite
> > what checkpatch.pl tells you, sorry.
>
> Statistics please.
>
> I believe it's not a common pattern.

I get 464 that have a blank line before the container_of #define and 185
that have no blank line.

Of the 464 that have a blank line, 135 contain clk in the file name.

julia