diff mbox

ath6kl: mark expected switch fall-throughs

Message ID 20180524231322.GA22704@embeddedor.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Gustavo A. R. Silva May 24, 2018, 11:13 p.m. UTC
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sergei Shtylyov May 25, 2018, 11:27 a.m. UTC | #1
Hello!

On 5/25/2018 2:13 AM, Gustavo A. R. Silva wrote:

> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>   drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> index 2ba8cf3..29e32cd 100644
> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> @@ -3898,17 +3898,17 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
>   	wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
>   	switch (ar->hw.cap) {
>   	case WMI_11AN_CAP:
> -		ht = true;
> +		ht = true; /* fall through */
>   	case WMI_11A_CAP:
>   		band_5gig = true;
>   		break;
>   	case WMI_11GN_CAP:
> -		ht = true;
> +		ht = true; /* fall through */
>   	case WMI_11G_CAP:
>   		band_2gig = true;
>   		break;
>   	case WMI_11AGN_CAP:
> -		ht = true;
> +		ht = true; /* fall through */
>   	case WMI_11AG_CAP:
>   		band_2gig = true;
>   		band_5gig = true;

    Hm, typically such comments are done on a line of their own, have never 
seen this style...

MBR, Sergei
Kalle Valo May 25, 2018, 1:30 p.m. UTC | #2
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> writes:

> On 5/25/2018 2:13 AM, Gustavo A. R. Silva wrote:
>
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>   drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>> index 2ba8cf3..29e32cd 100644
>> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
>> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>> @@ -3898,17 +3898,17 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
>>   	wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
>>   	switch (ar->hw.cap) {
>>   	case WMI_11AN_CAP:
>> -		ht = true;
>> +		ht = true; /* fall through */
>>   	case WMI_11A_CAP:
>>   		band_5gig = true;
>>   		break;
>>   	case WMI_11GN_CAP:
>> -		ht = true;
>> +		ht = true; /* fall through */
>>   	case WMI_11G_CAP:
>>   		band_2gig = true;
>>   		break;
>>   	case WMI_11AGN_CAP:
>> -		ht = true;
>> +		ht = true; /* fall through */
>>   	case WMI_11AG_CAP:
>>   		band_2gig = true;
>>   		band_5gig = true;
>
>    Hm, typically such comments are done on a line of their own, have
> never seen this style...

Yeah, I was wondering the same. Was there a particular reason for this?
Gustavo A. R. Silva May 25, 2018, 5:50 p.m. UTC | #3
On 05/25/2018 08:30 AM, Kalle Valo wrote:
> Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> writes:
> 
>> On 5/25/2018 2:13 AM, Gustavo A. R. Silva wrote:
>>
>>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>>> where we are expecting to fall through.
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>> ---
>>>    drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++---
>>>    1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> index 2ba8cf3..29e32cd 100644
>>> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> @@ -3898,17 +3898,17 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
>>>    	wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
>>>    	switch (ar->hw.cap) {
>>>    	case WMI_11AN_CAP:
>>> -		ht = true;
>>> +		ht = true; /* fall through */
>>>    	case WMI_11A_CAP:
>>>    		band_5gig = true;
>>>    		break;
>>>    	case WMI_11GN_CAP:
>>> -		ht = true;
>>> +		ht = true; /* fall through */
>>>    	case WMI_11G_CAP:
>>>    		band_2gig = true;
>>>    		break;
>>>    	case WMI_11AGN_CAP:
>>> -		ht = true;
>>> +		ht = true; /* fall through */
>>>    	case WMI_11AG_CAP:
>>>    		band_2gig = true;
>>>    		band_5gig = true;
>>
>>     Hm, typically such comments are done on a line of their own, have
>> never seen this style...
> 
> Yeah, I was wondering the same. Was there a particular reason for this?
> 

Sometimes people use this style for a one-line code block.

I can change it to the traditional style. No problem.

Thanks
--
Gustavo
Kalle Valo May 25, 2018, 6:10 p.m. UTC | #4
"Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:

> On 05/25/2018 08:30 AM, Kalle Valo wrote:
>> Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> writes:
>>
>>> On 5/25/2018 2:13 AM, Gustavo A. R. Silva wrote:
>>>
>>>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>>>> where we are expecting to fall through.
>>>>
>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>> ---
>>>>    drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++---
>>>>    1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>>> index 2ba8cf3..29e32cd 100644
>>>> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>>> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>>> @@ -3898,17 +3898,17 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
>>>>    	wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
>>>>    	switch (ar->hw.cap) {
>>>>    	case WMI_11AN_CAP:
>>>> -		ht = true;
>>>> +		ht = true; /* fall through */
>>>>    	case WMI_11A_CAP:
>>>>    		band_5gig = true;
>>>>    		break;
>>>>    	case WMI_11GN_CAP:
>>>> -		ht = true;
>>>> +		ht = true; /* fall through */
>>>>    	case WMI_11G_CAP:
>>>>    		band_2gig = true;
>>>>    		break;
>>>>    	case WMI_11AGN_CAP:
>>>> -		ht = true;
>>>> +		ht = true; /* fall through */
>>>>    	case WMI_11AG_CAP:
>>>>    		band_2gig = true;
>>>>    		band_5gig = true;
>>>
>>>     Hm, typically such comments are done on a line of their own, have
>>> never seen this style...
>>
>> Yeah, I was wondering the same. Was there a particular reason for this?
>>
>
> Sometimes people use this style for a one-line code block.
>
> I can change it to the traditional style. No problem.

I would prefer that. So if you can send v2 that would be great.
Gustavo A. R. Silva May 25, 2018, 6:14 p.m. UTC | #5
On 05/25/2018 01:10 PM, Kalle Valo wrote:
>>> Yeah, I was wondering the same. Was there a particular reason for this?
>>>
>>
>> Sometimes people use this style for a one-line code block.
>>
>> I can change it to the traditional style. No problem.
> 
> I would prefer that. So if you can send v2 that would be great.
> 

Yep. No problem. I'll send it shortly.

Thanks
--
Gustavo
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 2ba8cf3..29e32cd 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -3898,17 +3898,17 @@  int ath6kl_cfg80211_init(struct ath6kl *ar)
 	wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
 	switch (ar->hw.cap) {
 	case WMI_11AN_CAP:
-		ht = true;
+		ht = true; /* fall through */
 	case WMI_11A_CAP:
 		band_5gig = true;
 		break;
 	case WMI_11GN_CAP:
-		ht = true;
+		ht = true; /* fall through */
 	case WMI_11G_CAP:
 		band_2gig = true;
 		break;
 	case WMI_11AGN_CAP:
-		ht = true;
+		ht = true; /* fall through */
 	case WMI_11AG_CAP:
 		band_2gig = true;
 		band_5gig = true;