From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Bing Sun <sunbing@redflag-linux.com>
Cc: Larry.Finger@lwfinger.net, gregkh@linuxfoundation.org,
linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, sunbing.linux@gmail.com
Subject: Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue
Date: Thu, 11 Aug 2016 11:25:58 -0400 [thread overview]
Message-ID: <wrfja8gje395.fsf@redhat.com> (raw)
In-Reply-To: <1470924695-14931-1-git-send-email-sunbing@redflag-linux.com> (Bing Sun's message of "Thu, 11 Aug 2016 22:11:35 +0800")
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
next prev parent reply other threads:[~2016-08-11 15:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wrfja8gje395.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=sunbing.linux@gmail.com \
--cc=sunbing@redflag-linux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).