* [PATCH 0/7] staging:rtl8192u: Coding style changes
@ 2018-08-04 9:18 John Whitmore
2018-08-04 9:18 ` [PATCH 1/7] staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style John Whitmore
` (6 more replies)
0 siblings, 7 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Cleanup of the drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h file as
the QOS_TCLAS union was moved into this file, in a previous patch. The
type contained a number of naming issues.
John Whitmore (7):
staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style
staging:rtl8192u: Rename types in QOS_TCLAS union - Style
staging:rtl8192u: Rename multiple variables - Style
staging:rtl8192u: Remove blank line - Style
staging:rtl8192u: Remove comments - Style
staging:rtl8192u: Remove unused member variable - Style
staging:rtl8192u: Replace magic number with defined constant - Style
.../staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
.../rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
.../staging/rtl8192u/ieee80211/rtl819x_TS.h | 99 +++++++++----------
.../rtl8192u/ieee80211/rtl819x_TSProc.c | 6 +-
4 files changed, 54 insertions(+), 55 deletions(-)
--
2.18.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/7] staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
2018-08-04 9:18 ` [PATCH 2/7] staging:rtl8192u: Rename types in QOS_TCLAS union " John Whitmore
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Remove the typedef from the union QOS_TCLAS, which causes a checkpatch
issue with defining new types. In addition, as a type, the name should
be in lowercase so has been changed.
These are coding style changes and should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 6 +++---
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 5cf00a2e08ae..823ba363e0ab 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -14,7 +14,7 @@ enum tr_select {
RX_DIR = 1,
};
-typedef union _QOS_TCLAS {
+union qos_tclas {
struct _TYPE_GENERAL {
u8 Priority;
@@ -63,7 +63,7 @@ typedef union _QOS_TCLAS {
u8 Mask;
u16 TagType;
} TYPE2_8021Q;
-} QOS_TCLAS, *PQOS_TCLAS;
+};
struct ts_common_info {
struct list_head list;
@@ -71,7 +71,7 @@ struct ts_common_info {
struct timer_list inact_timer;
u8 addr[6];
struct tspec_body t_spec;
- QOS_TCLAS t_class[TCLAS_NUM];
+ union qos_tclas t_class[TCLAS_NUM];
u8 t_clas_proc;
u8 t_clas_num;
};
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index de06cd11ab65..d46d8f468671 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -105,7 +105,7 @@ static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->t_spec, 0, sizeof(struct tspec_body));
- memset(&pTsCommonInfo->t_class, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
+ memset(&pTsCommonInfo->t_class, 0, sizeof(union qos_tclas)*TCLAS_NUM);
pTsCommonInfo->t_clas_proc = 0;
pTsCommonInfo->t_clas_num = 0;
}
@@ -265,7 +265,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee,
}
static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr,
- struct tspec_body *pTSPEC, PQOS_TCLAS pTCLAS, u8 TCLAS_Num,
+ struct tspec_body *pTSPEC, union qos_tclas *pTCLAS, u8 TCLAS_Num,
u8 TCLAS_Proc)
{
u8 count;
@@ -279,7 +279,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr,
memcpy((u8 *)(&(pTsCommonInfo->t_spec)), (u8 *)pTSPEC, sizeof(struct tspec_body));
for(count = 0; count < TCLAS_Num; count++)
- memcpy((u8 *)(&(pTsCommonInfo->t_class[count])), (u8 *)pTCLAS, sizeof(QOS_TCLAS));
+ memcpy((u8 *)(&(pTsCommonInfo->t_class[count])), (u8 *)pTCLAS, sizeof(union qos_tclas));
pTsCommonInfo->t_clas_proc = TCLAS_Proc;
pTsCommonInfo->t_clas_num = TCLAS_Num;
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/7] staging:rtl8192u: Rename types in QOS_TCLAS union - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
2018-08-04 9:18 ` [PATCH 1/7] staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
2018-08-04 9:18 ` [PATCH 3/7] staging:rtl8192u: Rename multiple variables " John Whitmore
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Whilst none of the structures inside the qos_tclas union are used, their
names conflict with the coding standard being named in uppercase.
The names of all five have been changed to lowercase.
This is a style change, and since none of the structures are referenced,
these changes should have no impact on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
.../staging/rtl8192u/ieee80211/rtl819x_TS.h | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 823ba363e0ab..c352ba0bcd8f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -16,22 +16,22 @@ enum tr_select {
union qos_tclas {
- struct _TYPE_GENERAL {
+ struct type_general {
u8 Priority;
u8 ClassifierType;
u8 Mask;
- } TYPE_GENERAL;
+ } type_general;
- struct _TYPE0_ETH {
+ struct type0_eth {
u8 Priority;
u8 ClassifierType;
u8 Mask;
u8 SrcAddr[6];
u8 DstAddr[6];
u16 Type;
- } TYPE0_ETH;
+ } type0_eth;
- struct _TYPE1_IPV4 {
+ struct type1_ipv4 {
u8 Priority;
u8 ClassifierType;
u8 Mask;
@@ -43,9 +43,9 @@ union qos_tclas {
u8 DSCP;
u8 Protocol;
u8 Reserved;
- } TYPE1_IPV4;
+ } type1_ipv4;
- struct _TYPE1_IPV6 {
+ struct type1_ipv6 {
u8 Priority;
u8 ClassifierType;
u8 Mask;
@@ -55,14 +55,14 @@ union qos_tclas {
u16 SrcPort;
u16 DstPort;
u8 FlowLabel[3];
- } TYPE1_IPV6;
+ } type1_ipv6;
- struct _TYPE2_8021Q {
+ struct type2_8021q {
u8 Priority;
u8 ClassifierType;
u8 Mask;
u16 TagType;
- } TYPE2_8021Q;
+ } type2_8021q;
};
struct ts_common_info {
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/7] staging:rtl8192u: Rename multiple variables - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
2018-08-04 9:18 ` [PATCH 1/7] staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style John Whitmore
2018-08-04 9:18 ` [PATCH 2/7] staging:rtl8192u: Rename types in QOS_TCLAS union " John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
2018-08-04 9:18 ` [PATCH 4/7] staging:rtl8192u: Remove blank line " John Whitmore
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
All of the variables used within the structures of the union qos_tclas
cause checkpatch issue due to CamelCase naming. As none the member
variables are used in code all have been changed on one patch.
These changes are coding style in nature and should not impact runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
.../staging/rtl8192u/ieee80211/rtl819x_TS.h | 66 +++++++++----------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index c352ba0bcd8f..508ed639cda5 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -17,51 +17,51 @@ enum tr_select {
union qos_tclas {
struct type_general {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
+ u8 priority;
+ u8 classifier_type;
+ u8 mask;
} type_general;
struct type0_eth {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u8 SrcAddr[6];
- u8 DstAddr[6];
- u16 Type;
+ u8 priority;
+ u8 classifier_type;
+ u8 mask;
+ u8 src_addr[6];
+ u8 dst_addr[6];
+ u16 type;
} type0_eth;
struct type1_ipv4 {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u8 Version;
- u8 SrcIP[4];
- u8 DstIP[4];
- u16 SrcPort;
- u16 DstPort;
- u8 DSCP;
- u8 Protocol;
- u8 Reserved;
+ u8 priority;
+ u8 classifier_type;
+ u8 mask;
+ u8 version;
+ u8 src_ip[4];
+ u8 dst_ip[4];
+ u16 src_port;
+ u16 dst_port;
+ u8 dscp;
+ u8 protocol;
+ u8 reserved;
} type1_ipv4;
struct type1_ipv6 {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u8 Version;
- u8 SrcIP[16];
- u8 DstIP[16];
- u16 SrcPort;
- u16 DstPort;
- u8 FlowLabel[3];
+ u8 priority;
+ u8 classifier_type;
+ u8 mask;
+ u8 version;
+ u8 src_ip[16];
+ u8 dst_ip[16];
+ u16 src_port;
+ u16 dst_port;
+ u8 flow_label[3];
} type1_ipv6;
struct type2_8021q {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u16 TagType;
+ u8 priority;
+ u8 classifier_type;
+ u8 mask;
+ u16 tag_type;
} type2_8021q;
};
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/7] staging:rtl8192u: Remove blank line - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
` (2 preceding siblings ...)
2018-08-04 9:18 ` [PATCH 3/7] staging:rtl8192u: Rename multiple variables " John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
2018-08-04 9:18 ` [PATCH 5/7] staging:rtl8192u: Remove comments " John Whitmore
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Removal of a blank like which causes a checkpatch issue.
This is a simple coding style change and should have no impact on
runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 508ed639cda5..93984e8e87c3 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -15,7 +15,6 @@ enum tr_select {
};
union qos_tclas {
-
struct type_general {
u8 priority;
u8 classifier_type;
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/7] staging:rtl8192u: Remove comments - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
` (3 preceding siblings ...)
2018-08-04 9:18 ` [PATCH 4/7] staging:rtl8192u: Remove blank line " John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
2018-08-04 9:18 ` [PATCH 6/7] staging:rtl8192u: Remove unused member variable " John Whitmore
2018-08-04 9:18 ` [PATCH 7/7] staging:rtl8192u: Replace magic number with defined constant " John Whitmore
6 siblings, 0 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Removal of three comments. The comments in question do not add anything
to the understanding of the code, and if they are necessary it would
imply that the structure and its member variables are badly named.
This is a simple style change and should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 93984e8e87c3..924d4b373099 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -78,8 +78,8 @@ struct ts_common_info {
struct tx_ts_record {
struct ts_common_info ts_common_info;
u16 tx_cur_seq;
- BA_RECORD tx_pending_ba_record; /* For BA Originator */
- BA_RECORD tx_admitted_ba_record; /* For BA Originator */
+ BA_RECORD tx_pending_ba_record;
+ BA_RECORD tx_admitted_ba_record;
u8 add_ba_req_in_progress;
u8 add_ba_req_delayed;
u8 using_ba;
@@ -93,7 +93,7 @@ struct rx_ts_record {
u16 rx_timeout_indicate_seq;
struct list_head rx_pending_pkt_list;
struct timer_list rx_pkt_pending_timer;
- BA_RECORD rx_admitted_ba_record; /* For BA Recipient */
+ BA_RECORD rx_admitted_ba_record;
u16 rx_last_seq_num;
u8 rx_last_frag_num;
u8 num;
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/7] staging:rtl8192u: Remove unused member variable - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
` (4 preceding siblings ...)
2018-08-04 9:18 ` [PATCH 5/7] staging:rtl8192u: Remove comments " John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
2018-08-05 14:22 ` Greg KH
2018-08-04 9:18 ` [PATCH 7/7] staging:rtl8192u: Replace magic number with defined constant " John Whitmore
6 siblings, 1 reply; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Remove name of 'reserved' bitfield member which is simply used to pad
the bitfield to a byte boundary. The actual bit has been left in place
so alignment should not change. The name, which is not required has
been removed.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 3cfeac0d7214..fc449806dab8 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -114,7 +114,7 @@ struct cb_desc {
u8 bBroadcast:1;
//u8 reserved2:2;
u8 drv_agg_enable:1;
- u8 reserved2:1;
+ u8:1;
/* Tx Desc related element(12-19) */
u8 rata_index;
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/7] staging:rtl8192u: Replace magic number with defined constant - Style
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
` (5 preceding siblings ...)
2018-08-04 9:18 ` [PATCH 6/7] staging:rtl8192u: Remove unused member variable " John Whitmore
@ 2018-08-04 9:18 ` John Whitmore
6 siblings, 0 replies; 9+ messages in thread
From: John Whitmore @ 2018-08-04 9:18 UTC (permalink / raw)
To: linux-kernel; +Cc: devel, gregkh, John Whitmore
Replace the magic number '8' with defined constant which is normally used
'MAX_DEV_ADDR_SIZE'.
This is a coding style change which should have no impact on runtime code
execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 51cb5e4658b0..212cc9ccbb96 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -217,7 +217,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee
struct rtl_80211_hdr_3addr *header =
(struct rtl_80211_hdr_3addr *)skb->data;
- struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 8);
+ struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
spin_lock_irqsave(&ieee->lock, flags);
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 6/7] staging:rtl8192u: Remove unused member variable - Style
2018-08-04 9:18 ` [PATCH 6/7] staging:rtl8192u: Remove unused member variable " John Whitmore
@ 2018-08-05 14:22 ` Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2018-08-05 14:22 UTC (permalink / raw)
To: John Whitmore; +Cc: linux-kernel, devel
On Sat, Aug 04, 2018 at 10:18:58AM +0100, John Whitmore wrote:
> Remove name of 'reserved' bitfield member which is simply used to pad
> the bitfield to a byte boundary. The actual bit has been left in place
> so alignment should not change. The name, which is not required has
> been removed.
>
> This is a coding style change which should have no impact on runtime
> code execution.
>
> Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
> ---
> drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> index 3cfeac0d7214..fc449806dab8 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> @@ -114,7 +114,7 @@ struct cb_desc {
> u8 bBroadcast:1;
> //u8 reserved2:2;
> u8 drv_agg_enable:1;
> - u8 reserved2:1;
> + u8:1;
No, this is ok, and a common thing to do. Anonymous bit fields is not a
normal thing.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-08-05 14:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-04 9:18 [PATCH 0/7] staging:rtl8192u: Coding style changes John Whitmore
2018-08-04 9:18 ` [PATCH 1/7] staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style John Whitmore
2018-08-04 9:18 ` [PATCH 2/7] staging:rtl8192u: Rename types in QOS_TCLAS union " John Whitmore
2018-08-04 9:18 ` [PATCH 3/7] staging:rtl8192u: Rename multiple variables " John Whitmore
2018-08-04 9:18 ` [PATCH 4/7] staging:rtl8192u: Remove blank line " John Whitmore
2018-08-04 9:18 ` [PATCH 5/7] staging:rtl8192u: Remove comments " John Whitmore
2018-08-04 9:18 ` [PATCH 6/7] staging:rtl8192u: Remove unused member variable " John Whitmore
2018-08-05 14:22 ` Greg KH
2018-08-04 9:18 ` [PATCH 7/7] staging:rtl8192u: Replace magic number with defined constant " John Whitmore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).