Skip to contentSkip to conversation

staging: rtl8192u: fix sparse warnings

PATCH In review Fred Chou 2 participants 6 messages Dec 4, 2014 Staging

lore
Share & tools
lore

Fred Chou

author
#0 lore raw

PATCH v3 1/1 staging: rtl8192u: fix sparse warnings

From: Fred Chou <[email protected]>

Fixed the following warnings in sparse:

drivers/staging/rtl8192u/r8192U_core.c:670:6: warning:
symbol 'dump_eprom' was not declared.
Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1489:5: warning:
symbol 'ComputeTxTime' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning:
symbol 'txqueue2outpipe' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning:
symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static?

---
change in v3: fixed alignment to match open parenthesis

 drivers/staging/rtl8192u/r8192U_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +7 -5
index 7640386..2c61801 100644
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -1486,8 +1486,8 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
 
 u16 N_DBPSOfRate(u16 DataRate);
 
-u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
-		  u8 bShortPreamble)
+static u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
+			  u8 bShortPreamble)
 {
 	u16	FrameTime;
 	u16	N_DBPS;
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				     unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					 bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
Signature · 1 line
1.9.1
#1 lore raw
Quoted 17 lines · Fred Chou

From: Fred Chou <[email protected]>

Fixed the following warnings in sparse:

drivers/staging/rtl8192u/r8192U_core.c:670:6: warning:
symbol 'dump_eprom' was not declared.
Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1489:5: warning:
symbol 'ComputeTxTime' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning:
symbol 'txqueue2outpipe' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning:
symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static?

Quoted 4 lines

---
change in v3: fixed alignment to match open parenthesis

have u fixed?
your v2 was having one problem of alignment, but v3 is again having 3 problems.

and your patch doesnot apply to next-20141203

sudip

Quoted 56 lines
 drivers/staging/rtl8192u/r8192U_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +7 -5
index 7640386..2c61801 100644
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -1486,8 +1486,8 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
 
 u16 N_DBPSOfRate(u16 DataRate);
 
-u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
-		  u8 bShortPreamble)
+static u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
+			  u8 bShortPreamble)
 {
 	u16	FrameTime;
 	u16	N_DBPS;
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				     unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					 bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
author
#2 lore raw
Quoted 18 lines · Sudip Mukherjee
Quoted 17 lines · Fred Chou

From: Fred Chou <[email protected]>

Fixed the following warnings in sparse:

drivers/staging/rtl8192u/r8192U_core.c:670:6: warning:
symbol 'dump_eprom' was not declared.
Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1489:5: warning:
symbol 'ComputeTxTime' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning:
symbol 'txqueue2outpipe' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning:
symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static?

Quoted 8 lines
Quoted 4 lines

---
change in v3: fixed alignment to match open parenthesis

have u fixed?
your v2 was having one problem of alignment, but v3 is again having 3 problems. and your patch doesnot apply to next-20141203

The alignment issue is fixed when I apply the patch against my local kernel source tree. Wondering why there are still alignment problems. Let me test with next-20141203 and send v4 again. My apologies...

Fred

Quoted 58 lines

sudip

Quoted 56 lines
 drivers/staging/rtl8192u/r8192U_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +7 -5
index 7640386..2c61801 100644
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -1486,8 +1486,8 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
 
 u16 N_DBPSOfRate(u16 DataRate);
 
-u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
-		  u8 bShortPreamble)
+static u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
+			  u8 bShortPreamble)
 {
 	u16	FrameTime;
 	u16	N_DBPS;
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				     unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					 bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#3 lore raw
Quoted 25 lines · Fred Chou
Quoted 22 lines · Sudip Mukherjee
Quoted 21 lines · Fred Chou

From: Fred Chou <[email protected]>

Fixed the following warnings in sparse:

drivers/staging/rtl8192u/r8192U_core.c:670:6: warning:
symbol 'dump_eprom' was not declared.
Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1489:5: warning:
symbol 'ComputeTxTime' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning:
symbol 'txqueue2outpipe' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning:
symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static?

---
change in v3: fixed alignment to match open parenthesis

Quoted 8 lines
Quoted 4 lines

have u fixed?
your v2 was having one problem of alignment, but v3 is again having 3 problems. and your patch doesnot apply to next-20141203

The alignment issue is fixed when I apply the patch against my local kernel source tree. Wondering why there are still alignment problems. Let me test with next-20141203 and send v4 again. My apologies...

i think you have created your v3 on top of your v2.
reset the source before doing this one. and check the patch with checkpatch before sending.

thanks
sudip

Quoted 61 lines

Fred

Quoted 58 lines

sudip

Quoted 56 lines
 drivers/staging/rtl8192u/r8192U_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +7 -5
index 7640386..2c61801 100644
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -1486,8 +1486,8 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
 
 u16 N_DBPSOfRate(u16 DataRate);
 
-u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
-		  u8 bShortPreamble)
+static u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
+			  u8 bShortPreamble)
 {
 	u16	FrameTime;
 	u16	N_DBPS;
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				     unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					 bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
author
#4 lore raw
Quoted 35 lines · Sudip Mukherjee
Quoted 25 lines · Fred Chou
Quoted 22 lines · Sudip Mukherjee
Quoted 21 lines · Fred Chou

From: Fred Chou <[email protected]>

Fixed the following warnings in sparse:

drivers/staging/rtl8192u/r8192U_core.c:670:6: warning:
symbol 'dump_eprom' was not declared.
Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1489:5: warning:
symbol 'ComputeTxTime' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning:
symbol 'txqueue2outpipe' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning:
symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static?

---
change in v3: fixed alignment to match open parenthesis

Quoted 8 lines
Quoted 4 lines

have u fixed?
your v2 was having one problem of alignment, but v3 is again having 3 problems. and your patch doesnot apply to next-20141203

The alignment issue is fixed when I apply the patch against my local kernel source tree. Wondering why there are still alignment problems. Let me test with next-20141203 and send v4 again. My apologies...

Quoted 5 lines

i think you have created your v3 on top of your v2.
reset the source before doing this one. and check the patch with checkpatch before sending.

thanks
sudip

v3 is created from scratch. I removed the v2 patch when formatting the patch. checkpatch.pl does not report any zeros or warnings for both v2 and v3, and the alignment looks all right to me. That makes me very confused.

Quoted 61 lines
Quoted 61 lines

Fred

Quoted 58 lines

sudip

Quoted 56 lines
 drivers/staging/rtl8192u/r8192U_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +7 -5
index 7640386..2c61801 100644
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -1486,8 +1486,8 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
 
 u16 N_DBPSOfRate(u16 DataRate);
 
-u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
-		  u8 bShortPreamble)
+static u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
+			  u8 bShortPreamble)
 {
 	u16	FrameTime;
 	u16	N_DBPS;
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				     unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					 bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#5 lore raw
Quoted 41 lines · Fred Chou
Quoted 38 lines · Sudip Mukherjee
Quoted 25 lines · Fred Chou
Quoted 22 lines · Sudip Mukherjee
Quoted 21 lines · Fred Chou

From: Fred Chou <[email protected]>

Fixed the following warnings in sparse:

drivers/staging/rtl8192u/r8192U_core.c:670:6: warning:
symbol 'dump_eprom' was not declared.
Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1489:5: warning:
symbol 'ComputeTxTime' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning:
symbol 'txqueue2outpipe' was not declared. Should it be static?
drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning:
symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static?

---
change in v3: fixed alignment to match open parenthesis

Quoted 8 lines
Quoted 4 lines

have u fixed?
your v2 was having one problem of alignment, but v3 is again having 3 problems. and your patch doesnot apply to next-20141203

The alignment issue is fixed when I apply the patch against my local kernel source tree. Wondering why there are still alignment problems. Let me test with next-20141203 and send v4 again. My apologies...

i think you have created your v3 on top of your v2.
reset the source before doing this one. and check the patch with checkpatch before sending.

Quoted 7 lines
Quoted 2 lines

thanks
sudip

v3 is created from scratch. I removed the v2 patch when formatting the patch. checkpatch.pl does not report any zeros or warnings for both v2 and v3, and the alignment looks all right to me. That makes me very confused.

check your patch with checkpatch --strict , checkpatch will report if alignment is right or wrong. this time reset your source to next-20141204 , then create your patch from scratch.

thanks
sudip

Quoted 63 lines
Quoted 63 lines
Quoted 63 lines

Fred

Quoted 58 lines

sudip

Quoted 56 lines
 drivers/staging/rtl8192u/r8192U_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +7 -5
index 7640386..2c61801 100644
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -1486,8 +1486,8 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
 
 u16 N_DBPSOfRate(u16 DataRate);
 
-u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
-		  u8 bShortPreamble)
+static u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 bManagementFrame,
+			  u8 bShortPreamble)
 {
 	u16	FrameTime;
 	u16	N_DBPS;
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				     unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					 bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/