lkml.org 
[lkml]   [2016]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue
Date
Bing Sun <sunbing@redflag-linux.com> writes:
> 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;
> }

Pardon me here, but I find it really hard to see how this change is an
improvement over the old code in any shape or form.

Jes

\
 
 \ /
  Last update: 2016-08-11 18:01    [W:0.070 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site