Skip to contentSkip to conversation

staging:vt6656:baseband.h: fix function definition argument without identifier name issue

PATCH Superseded Mikhail Golubev 3 participants 8 messages Oct 13, 2016 – Oct 14, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging:vt6656:baseband.h: fix function definition argument without identifier name issue

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

---
 drivers/staging/vt6656/baseband.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/baseband.h +10 -10
index 7cc1387..fe1c25c 100644
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);
 
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+
+void vnt_set_short_slot_time(struct vnt_private *priv);
+void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data);
+void vnt_set_antenna_mode(struct vnt_private *priv, u8 antenna_mode);
+int vnt_vt3184_init(struct vnt_private *priv);
+void vnt_set_deep_sleep(struct vnt_private *priv);
+void vnt_exit_deep_sleep(struct vnt_private *priv);
+void vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning);
 
 #endif /* __BASEBAND_H__ */
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 1 line · Mikhail Golubev

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

Please wrap your changelog comments at 72 columns.

Quoted 17 lines
---
 drivers/staging/vt6656/baseband.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/baseband.h +0 -3
index 7cc1387..fe1c25c 100644
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);
 
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-

drivers/staging/vt6656/baseband.h struct vnt_phy_field { · line 91

Quoted 10 lines
drivers/staging/vt6656/baseband.h +3 -7
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+

Really? Since when is this a coding style requirement?

Don't use --strict, it's not worth it for stuff like this, there are far worse-off files in drivers/staging/ than this one.

thanks,

greg k-h

#2 lore raw
Quoted 19 lines · Greg KH
Quoted 1 line · Mikhail Golubev

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

Please wrap your changelog comments at 72 columns.

Quoted 14 lines
---
 drivers/staging/vt6656/baseband.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/baseband.h +0 -0
index 7cc1387..fe1c25c 100644
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);
 
Quoted 16 lines

drivers/staging/vt6656/baseband.h struct vnt_phy_field { · line 91

Quoted 13 lines
drivers/staging/vt6656/baseband.h +3 -10
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+

Really? Since when is this a coding style requirement?

This requirement is really new. It was proposed by Joe Perches at 26 Sep 2016:
[PATCH] checkpatch: Add warning for unnamed function definition.

Should this type of warnings be fixed here?

Quoted 6 lines

Don't use --strict, it's not worth it for stuff like this, there are far worse-off files in drivers/staging/ than this one.

thanks,

greg k-h

Best wishes,
Mike.

maintainer
#3 lore raw
Quoted 37 lines · Mikhail Golubev
Quoted 19 lines · Greg KH
Quoted 1 line · Mikhail Golubev

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

Please wrap your changelog comments at 72 columns.

Quoted 14 lines
---
 drivers/staging/vt6656/baseband.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/baseband.h +0 -0
index 7cc1387..fe1c25c 100644
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);
 
Quoted 16 lines

drivers/staging/vt6656/baseband.h struct vnt_phy_field { · line 91

Quoted 13 lines
drivers/staging/vt6656/baseband.h +3 -10
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+

Really? Since when is this a coding style requirement?

Quoted 4 lines

This requirement is really new. It was proposed by Joe Perches at 26 Sep 2016:
[PATCH] checkpatch: Add warning for unnamed function definition.

Should this type of warnings be fixed here?

Ugh, Joe, why did you add this option?

What is it going to help out with?

thanks,

greg k-h

#4 lore raw
Quoted 4 lines · Greg KH
Quoted 3 lines · Mikhail Golubev
Quoted 2 lines · Greg KH
Quoted 1 line · Mikhail Golubev

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/vt6656/baseband.h

Quoted 1 line
drivers/staging/vt6656/baseband.h +0 -0

[]

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 7 lines
drivers/staging/vt6656/baseband.h +0 -3
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);p
 
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-

drivers/staging/vt6656/baseband.h struct vnt_phy_field { · line 91

Quoted 10 lines
drivers/staging/vt6656/baseband.h +3 -7
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+

Really? Since when is this a coding style requirement?

Quoted 5 lines
Quoted 4 lines

This requirement is really new. It was proposed by Joe Perches at 26 Sep 2016:
[PATCH] checkpatch: Add warning for unnamed function definition.

Should this type of warnings be fixed here?

Ugh, Joe, why did you add this option?

1. Most all kernel prototypes use named arguments.
2. It helps make header files easier to read/lookup with grep.

int func(int, int, int)
vs
int func(int weight, int density, int mass)

which is easier for humans to use?

maintainer
#5 lore raw
Quoted 32 lines · Joe Perches
Quoted 4 lines · Greg KH
Quoted 3 lines · Mikhail Golubev
Quoted 2 lines · Greg KH
Quoted 1 line · Mikhail Golubev

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/vt6656/baseband.h

Quoted 1 line
drivers/staging/vt6656/baseband.h +0 -0

[]

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 7 lines
drivers/staging/vt6656/baseband.h +0 -3
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);p
 
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-

drivers/staging/vt6656/baseband.h struct vnt_phy_field { · line 91

Quoted 10 lines
drivers/staging/vt6656/baseband.h +3 -7
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+

Really? Since when is this a coding style requirement?

Quoted 5 lines
Quoted 4 lines

This requirement is really new. It was proposed by Joe Perches at 26 Sep 2016:
[PATCH] checkpatch: Add warning for unnamed function definition.

Should this type of warnings be fixed here?

Ugh, Joe, why did you add this option?

Quoted 8 lines

1. Most all kernel prototypes use named arguments.
2. It helps make header files easier to read/lookup with grep.

int func(int, int, int)
vs
int func(int weight, int density, int mass)

which is easier for humans to use?

Yes, which is why I use that format, but is it something we are now going to suddenly require?

Also, this is going to take a lot more work to review patches like this, to match up the variable names to ensure that the developer got it right...

thanks,

greg k-h

#6 lore raw
Quoted 49 lines · Greg KH
Quoted 38 lines · Joe Perches
Quoted 4 lines · Greg KH
Quoted 3 lines · Mikhail Golubev
Quoted 2 lines · Greg KH
Quoted 1 line · Mikhail Golubev

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/vt6656/baseband.h

Quoted 1 line
drivers/staging/vt6656/baseband.h +0 -0

[]

Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 7 lines
drivers/staging/vt6656/baseband.h +0 -3
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);p
 
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-

drivers/staging/vt6656/baseband.h struct vnt_phy_field { · line 91

Quoted 10 lines
drivers/staging/vt6656/baseband.h +3 -7
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+

Really? Since when is this a coding style requirement?

Quoted 6 lines
Quoted 4 lines

This requirement is really new. It was proposed by Joe Perches at 26 Sep 2016:
[PATCH] checkpatch: Add warning for unnamed function definition.

Should this type of warnings be fixed here?

Ugh, Joe, why did you add this option?

Quoted 8 lines

1. Most all kernel prototypes use named arguments.
2. It helps make header files easier to read/lookup with grep.

int func(int, int, int)
vs
int func(int weight, int density, int mass)

which is easier for humans to use?

Quoted 6 lines

Yes, which is why I use that format, but is it something we are now going to suddenly require?

Also, this is going to take a lot more work to review patches like this, to match up the variable names to ensure that the developer got it right...

Coccinelle to the rescue...

http://www.spinics.net/lists/linux-kernel-janitors/msg28450.html

Julia Lawall wrote a script for that. Unfortunately, it doesn't currently span .h and .c files

---

@r@
identifier f;
position p;
type T, t;
parameter list[n] ps;
@@

T f@p(ps,t,...);

@s@
identifier r.f,x;
type r.T, r.t;
parameter list[r.n] ps;
@@

T f(ps,t x,...) { ... }

@@
identifier r.f, s.x;
position r.p;
type r.T, r.t;
parameter list[r.n] ps;
@@

T f@p(ps,t
+ x
  ,...);

#7 lore raw

PATCH v2 1/1 staging:vt6656:baseband.h: fix function definition argument without identifier name issue

In reply to Greg KH

Function definitions arguments should also have an identifier name as reported by checkpatch.pl.

---
Changes in v2:
- Make the changelog comment wrapped at 72 columns.

 drivers/staging/vt6656/baseband.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/baseband.h +10 -10
index 7cc1387..fe1c25c 100644
@@ -86,15 +86,15 @@ struct vnt_phy_field {
 unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 				unsigned int frame_length, u16 tx_rate);
 
-void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
-		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-
-void vnt_set_short_slot_time(struct vnt_private *);
-void vnt_set_vga_gain_offset(struct vnt_private *, u8);
-void vnt_set_antenna_mode(struct vnt_private *, u8);
-int vnt_vt3184_init(struct vnt_private *);
-void vnt_set_deep_sleep(struct vnt_private *);
-void vnt_exit_deep_sleep(struct vnt_private *);
-void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
+void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
+		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
+
+void vnt_set_short_slot_time(struct vnt_private *priv);
+void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data);
+void vnt_set_antenna_mode(struct vnt_private *priv, u8 antenna_mode);
+int vnt_vt3184_init(struct vnt_private *priv);
+void vnt_set_deep_sleep(struct vnt_private *priv);
+void vnt_exit_deep_sleep(struct vnt_private *priv);
+void vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning);
 
 #endif /* __BASEBAND_H__ */
Signature · 1 line
2.7.4