Skip to contentSkip to conversation

staging: i4l: move open brace to previous line

PATCH In review Elizabeth Ferdman 2 participants 4 messages Oct 6, 2016 – Oct 8, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: i4l: move open brace to previous line

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

---
 drivers/staging/i4l/act2000/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/act2000/module.c +1 -2
index 0573f51..4746a62 100644
@@ -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,
 };
Signature · 1 line
2.1.4
#1 lore raw
Quoted 13 lines · Elizabeth Ferdman

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

---
 drivers/staging/i4l/act2000/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/act2000/module.c +0 -0
index 0573f51..4746a62 100644

drivers/staging/i4l/act2000/module.c line 25

Quoted 9 lines
drivers/staging/i4l/act2000/module.c +1 -2
@@ -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

Quoted 10 lines

--
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 [email protected]. To post to this group, send email to [email protected].
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.

#2 lore raw
Quoted 20 lines · Julia Lawall
Quoted 16 lines · Elizabeth Ferdman

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

---
 drivers/staging/i4l/act2000/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/act2000/module.c +0 -0
index 0573f51..4746a62 100644
@@ -19,8 +19,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 
Quoted 9 lines

drivers/staging/i4l/act2000/module.c line 25

Quoted 6 lines
drivers/staging/i4l/act2000/module.c +1 -2
-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

Quoted 12 lines

julia

Quoted 10 lines

--
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 [email protected]. To post to this group, send email to [email protected].
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.

#3 lore raw
Quoted 40 lines · Elizabeth Ferdman
Quoted 20 lines · Julia Lawall
Quoted 16 lines · Elizabeth Ferdman

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

---
 drivers/staging/i4l/act2000/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/act2000/module.c +0 -0
index 0573f51..4746a62 100644
@@ -19,8 +19,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 
Quoted 9 lines

drivers/staging/i4l/act2000/module.c line 25

Quoted 6 lines
drivers/staging/i4l/act2000/module.c +1 -2
-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.

Quoted 3 lines

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