staging: rtl8192u: Remove typedef for struct.
PATCH 1/1 staging: rtl8192u: Remove typedef for struct.
Challenge suggested by coccinelle.
Linux kernel coding style guidelines suggest not using typedefs for structure.
The following Coccinelle semantic patch detects the cases for struct type:
@tn@
identifier i;
type td;
@@
-typedef
struct i { ... }
-td
;
@@
type tn.td;
identifier tn.i;
@@
-td
+ struct i
--- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +2 -2
@@ -296,7 +296,7 @@ struct cb_desc {#define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl -typedef struct ieee_param { +struct ieee_param {u32 cmd;u8 sta_addr[ETH_ALEN ];union {
@@ -323,7 +323,7 @@ typedef struct ieee_param {u8 key[0 ]; } crypt; } u; -} ieee_param; +};// linux under 2.6.9 release may not support it, so modify it for common use
Signature · 1 line
2.17.1
Quoted 17 lines · Sanjana Sanikommu
Challenge suggested by coccinelle.
Linux kernel coding style guidelines suggest not using typedefs for structure.
The following Coccinelle semantic patch detects the cases for struct type:@tn@
identifier i;
type td;
@@(quoted diff) +0
-2-typedef struct i { ... } -td ;
Quoted 7 lines
@@
type tn.td;
identifier tn.i;
@@-td
+ struct i
It is suspicious that you have a change to a typedef, but no changes to uses. I see that you have a rule for taking case of the uses, which is a good idea, but Coccinelle may not be looking at the .c file that uses the type and the .h file at the same time. Did you check that ieee_param doesn't currently appear anywhere without struct in front of it? Compiling the driver is a good test, but it is good to ceck with grep as well, in case there are some uses that are not getting compipled in your configuration.
julia
Quoted 38 lines
Signed-off-by Sanjana Sanikommu <[email protected]>--- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rtl8192u/ieee80211/ieee80211.h +2
-3@@ -296,7 +296,7 @@ struct cb_desc {#define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl -typedef struct ieee_param { +struct ieee_param {u32 cmd;u8 sta_addr[ETH_ALEN ];union {@@ -323,7 +323,7 @@ typedef struct ieee_param {u8 key[0 ]; } crypt; } u; -} ieee_param; +};// linux under 2.6.9 release may not support it, so modify it for common use --2.17.1
--
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/20190326170942.19974-1-sanjana99reddy99%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 26 lines · On Tue, 26 Mar 2019, 23:01 Julia Lawall, <[email protected]> wrote:
Quoted 22 lines · Sanjana Sanikommu
Challenge suggested by coccinelle.
Linux kernel coding style guidelines suggest not using typedefs for structure.
The following Coccinelle semantic patch detects the cases for struct type:@tn@
identifier i;
type td;
@@(quoted diff) +0
-2-typedef struct i { ... } -td ;@@
type tn.td;
identifier tn.i;
@@
Quoted 12 lines
Quoted 2 lines
-td
+ struct iIt is suspicious that you have a change to a typedef, but no changes to uses. I see that you have a rule for taking case of the uses, which is a good idea, but Coccinelle may not be looking at the .c file that uses the type and the .h file at the same time. Did you check that
ieee_paramdoesn't currently appear anywhere without struct in front of it? Compiling the driver is a good test, but it is good to ceck with grep as well, in case there are some uses that are not getting compipled in your configuration.
Sure, I will check.
Sanjana
Quoted 48 lines
julia
Review
Quoted 7 lines
Signed-off-by Sanjana Sanikommu <[email protected]>--- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/staging/rtl8192u/ieee80211/ieee80211.hQuoted 13 lines
index
8aa536d79900..48b5088e1fef100644drivers/staging/rtl8192u/ieee80211/ieee80211.h +1
-1@@ -296,7 +296,7 @@ struct cb_desc {#define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl -typedef struct ieee_param { +struct ieee_param {u32 cmd;u8 sta_addr[ETH_ALEN ];union {drivers/staging/rtl8192u/ieee80211/ieee80211.h typedef struct ieee_param { · line 329
Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +1
-1@@ -323,7 +323,7 @@ typedef struct ieee_param {u8 key[0 ]; } crypt; } u; -} ieee_param; +};// linux under 2.6.9 release may not support it, so modify it for common use
Quoted 5 lines
--
2.17.1--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Greg KH
maintainerQuoted 26 lines · Julia Lawall
Quoted 22 lines · Sanjana Sanikommu
Challenge suggested by coccinelle.
Linux kernel coding style guidelines suggest not using typedefs for structure.
The following Coccinelle semantic patch detects the cases for struct type:@tn@
identifier i;
type td;
@@(quoted diff) +0
-2-typedef struct i { ... } -td ;@@
type tn.td;
identifier tn.i;
@@
Quoted 11 lines
Quoted 2 lines
-td
+ struct iIt is suspicious that you have a change to a typedef, but no changes to uses. I see that you have a rule for taking case of the uses, which is a good idea, but Coccinelle may not be looking at the .c file that uses the type and the .h file at the same time. Did you check that
ieee_paramdoesn't currently appear anywhere without struct in front of it? Compiling the driver is a good test, but it is good to ceck with grep as well, in case there are some uses that are not getting compipled in your configuration.
It looks like the patch is correct, nothing else uses the typedef, so I've queued it up now.
thanks,
greg k-h