linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue
@ 2016-08-11 14:11 Bing Sun
  2016-08-11 15:25 ` Jes Sorensen
  0 siblings, 1 reply; 9+ messages in thread
From: Bing Sun @ 2016-08-11 14:11 UTC (permalink / raw)
  To: Larry.Finger, Jes.Sorensen
  Cc: gregkh, linux-wireless, devel, linux-kernel, sunbing.linux,
	Bing Sun

Fixed sparse parse error:
Expected constant expression in case statement.

Signed-off-by: Bing Sun <sunbing@redflag-linux.com>
---
 drivers/staging/rtl8723au/os_dep/os_intfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c
index b8848c2..f30d5d2 100644
--- a/drivers/staging/rtl8723au/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c
@@ -283,14 +283,13 @@ static u32 rtw_classify8021d(struct sk_buff *skb)
 	 */
 	if (skb->priority >= 256 && skb->priority <= 263)
 		return skb->priority - 256;
-	switch (skb->protocol) {
-	case htons(ETH_P_IP):
+
+	if (skb->protocol == htons(ETH_P_IP)) {
 		dscp = ip_hdr(skb)->tos & 0xfc;
-		break;
-	default:
-		return 0;
+		return dscp >> 5;
 	}
-	return dscp >> 5;
+
+	return 0;
 }
 
 static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb,
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-15  6:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 14:11 [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Bing Sun
2016-08-11 15:25 ` Jes Sorensen
2016-08-11 22:50   ` sunbing
2016-08-12 14:30     ` Jes Sorensen
2016-08-13  9:26       ` sunbing
2016-08-14 12:07         ` Joe Perches
2016-08-14 12:15           ` Johannes Berg
2016-08-14 12:23             ` Joe Perches
2016-08-15  6:07               ` Johannes Berg

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).