Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1460846
| From | sunbing <sunbing@redflag-linux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue |
| Date | 2016-08-12 01:00 +0200 |
| Message-ID | <s577b-1Km-11@gated-at.bofh.it> (permalink) |
| References | <s4YZX-4Uf-23@gated-at.bofh.it> <s505H-5ym-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Aug 11, 2016, at 23:25, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> 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
There is no functional improvement.
But before this patch, when we do: make C=1 M=drivers/staging/rtl8723au/
An error output:
drivers/staging/rtl8723au//os_dep/os_intfs.c:287:14: error: Expected constant expression in case statement
To avoid sparse parse error, a case statement converts to an if statement.
So we got this patch.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Bing Sun <sunbing@redflag-linux.com> - 2016-08-11 16:20 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-08-11 17:30 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue sunbing <sunbing@redflag-linux.com> - 2016-08-12 01:00 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-08-12 16:40 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue sunbing <sunbing@redflag-linux.com> - 2016-08-13 11:30 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Joe Perches <joe@perches.com> - 2016-08-14 14:10 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Johannes Berg <johannes@sipsolutions.net> - 2016-08-14 14:20 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Joe Perches <joe@perches.com> - 2016-08-14 14:30 +0200
Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue Johannes Berg <johannes@sipsolutions.net> - 2016-08-15 08:10 +0200
csiph-web