All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: i4l: move open brace to previous line
@ 2016-10-06 21:41 Elizabeth Ferdman
  2016-10-07  5:23 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Elizabeth Ferdman @ 2016-10-06 21:41 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: gregkh, amsfield22, daniel.baluta

Fix checkpatch error "open brace should be on previous line" since only
functions should have their opening brace on a new line.

Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
---
 drivers/staging/i4l/act2000/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/act2000/module.c b/drivers/staging/i4l/act2000/module.c
index 0573f51..4746a62 100644
--- a/drivers/staging/i4l/act2000/module.c
+++ b/drivers/staging/i4l/act2000/module.c
@@ -19,8 +19,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 
-static unsigned short act2000_isa_ports[] =
-{
+static unsigned short act2000_isa_ports[] = {
 	0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
 	0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
 };
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: i4l: move open brace to previous line
  2016-10-06 21:41 [PATCH] staging: i4l: move open brace to previous line Elizabeth Ferdman
@ 2016-10-07  5:23 ` Julia Lawall
  2016-10-07 23:13   ` Elizabeth Ferdman
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2016-10-07  5:23 UTC (permalink / raw)
  To: Elizabeth Ferdman; +Cc: outreachy-kernel, gregkh, amsfield22, daniel.baluta



On Thu, 6 Oct 2016, Elizabeth Ferdman wrote:

> Fix checkpatch error "open brace should be on previous line" since only
> functions should have their opening brace on a new line.
>
> Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
> ---
>  drivers/staging/i4l/act2000/module.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/i4l/act2000/module.c b/drivers/staging/i4l/act2000/module.c
> index 0573f51..4746a62 100644
> --- a/drivers/staging/i4l/act2000/module.c
> +++ b/drivers/staging/i4l/act2000/module.c
> @@ -19,8 +19,7 @@
>  #include <linux/slab.h>
>  #include <linux/init.h>
>
> -static unsigned short act2000_isa_ports[] =
> -{
> +static unsigned short act2000_isa_ports[] = {
>  	0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
>  	0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
>  };

Not related to this patch, but could this array be const?

julia

> --
> 2.1.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161006214116.GA10879%40localhost.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: i4l: move open brace to previous line
  2016-10-07  5:23 ` [Outreachy kernel] " Julia Lawall
@ 2016-10-07 23:13   ` Elizabeth Ferdman
  2016-10-08  6:02     ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Elizabeth Ferdman @ 2016-10-07 23:13 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

On Fri, Oct 07, 2016 at 07:23:12AM +0200, Julia Lawall wrote:
> 
> 
> On Thu, 6 Oct 2016, Elizabeth Ferdman wrote:
> 
> > Fix checkpatch error "open brace should be on previous line" since only
> > functions should have their opening brace on a new line.
> >
> > Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
> > ---
> >  drivers/staging/i4l/act2000/module.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/i4l/act2000/module.c b/drivers/staging/i4l/act2000/module.c
> > index 0573f51..4746a62 100644
> > --- a/drivers/staging/i4l/act2000/module.c
> > +++ b/drivers/staging/i4l/act2000/module.c
> > @@ -19,8 +19,7 @@
> >  #include <linux/slab.h>
> >  #include <linux/init.h>
> >
> > -static unsigned short act2000_isa_ports[] =
> > -{
> > +static unsigned short act2000_isa_ports[] = {
> >  	0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
> >  	0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
> >  };
> 
> Not related to this patch, but could this array be const?
> 
hey julia,
i'm looking into that but I don't know how to definitively answer that
question... what's a good way to go about that?

So far I've looked at the file, searched for occurrences of that array
in the file, and I don't see the array being altered. However it is
passed to some functions as in if(somefunction(act2000_isa_ports))...
And then those functions pass it to other functions. The functions
aren't saying const to show that they won't be altering the array. 

So it's kind of hard to know if it ever gets changed. Do you think that
just adding the word "const" after static, and then successfully 
compiling would mean that it does work? 

thanks,
liz

> julia
> 
> > --
> > 2.1.4
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161006214116.GA10879%40localhost.
> > For more options, visit https://groups.google.com/d/optout.
> >


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: i4l: move open brace to previous line
  2016-10-07 23:13   ` Elizabeth Ferdman
@ 2016-10-08  6:02     ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-10-08  6:02 UTC (permalink / raw)
  To: Elizabeth Ferdman; +Cc: outreachy-kernel



On Fri, 7 Oct 2016, Elizabeth Ferdman wrote:

> On Fri, Oct 07, 2016 at 07:23:12AM +0200, Julia Lawall wrote:
> >
> >
> > On Thu, 6 Oct 2016, Elizabeth Ferdman wrote:
> >
> > > Fix checkpatch error "open brace should be on previous line" since only
> > > functions should have their opening brace on a new line.
> > >
> > > Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
> > > ---
> > >  drivers/staging/i4l/act2000/module.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/staging/i4l/act2000/module.c b/drivers/staging/i4l/act2000/module.c
> > > index 0573f51..4746a62 100644
> > > --- a/drivers/staging/i4l/act2000/module.c
> > > +++ b/drivers/staging/i4l/act2000/module.c
> > > @@ -19,8 +19,7 @@
> > >  #include <linux/slab.h>
> > >  #include <linux/init.h>
> > >
> > > -static unsigned short act2000_isa_ports[] =
> > > -{
> > > +static unsigned short act2000_isa_ports[] = {
> > >  	0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
> > >  	0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
> > >  };
> >
> > Not related to this patch, but could this array be const?
> >
> hey julia,
> i'm looking into that but I don't know how to definitively answer that
> question... what's a good way to go about that?
>
> So far I've looked at the file, searched for occurrences of that array
> in the file, and I don't see the array being altered. However it is
> passed to some functions as in if(somefunction(act2000_isa_ports))...
> And then those functions pass it to other functions. The functions
> aren't saying const to show that they won't be altering the array.
>
> So it's kind of hard to know if it ever gets changed. Do you think that
> just adding the word "const" after static, and then successfully
> compiling would mean that it does work?

No, you need const declarations all the way down the line.  gcc doesn't
infer them.  If they are only local functions, then you should be able to
work it out.  If the array gets paseed to functions that are not in the
staging driver, then perhaps it is better to let it go at this point.

julia


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-08  6:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06 21:41 [PATCH] staging: i4l: move open brace to previous line Elizabeth Ferdman
2016-10-07  5:23 ` [Outreachy kernel] " Julia Lawall
2016-10-07 23:13   ` Elizabeth Ferdman
2016-10-08  6:02     ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.