diff mbox

ath5k: fix misplaced default label in sifs switch

Message ID 1464871430-23803-1-git-send-email-me@bobcopeland.com (mailing list archive)
State Accepted
Commit deb85bb1dadf8b4aaa5b33497766dc3f3e4b530e
Delegated to: Kalle Valo
Headers show

Commit Message

Bob Copeland June 2, 2016, 12:43 p.m. UTC
In this switch statement, the default case does not always assign
sifs.  In practice, ah->ah_bwmode cannot take values besides the
other labels, so this is not an actual problem, but it looks odd
and smatch complains thus:

    ath5k_hw_get_default_sifs() warn: missing break? reassigning 'sifs'

Silence the warning by moving default label up a line.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/pcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo June 14, 2016, 12:18 p.m. UTC | #1
Bob Copeland <me@bobcopeland.com> wrote:
> In this switch statement, the default case does not always assign
> sifs.  In practice, ah->ah_bwmode cannot take values besides the
> other labels, so this is not an actual problem, but it looks odd
> and smatch complains thus:
> 
>     ath5k_hw_get_default_sifs() warn: missing break? reassigning 'sifs'
> 
> Silence the warning by moving default label up a line.
> 
> Signed-off-by: Bob Copeland <me@bobcopeland.com>

Thanks, 1 patch applied to ath-next branch of ath.git:

deb85bb1dadf ath5k: fix misplaced default label in sifs switch
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index fc47b70..f23c851 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -219,8 +219,8 @@  ath5k_hw_get_default_sifs(struct ath5k_hw *ah)
 		sifs = AR5K_INIT_SIFS_QUARTER_RATE;
 		break;
 	case AR5K_BWMODE_DEFAULT:
-		sifs = AR5K_INIT_SIFS_DEFAULT_BG;
 	default:
+		sifs = AR5K_INIT_SIFS_DEFAULT_BG;
 		if (channel->band == NL80211_BAND_5GHZ)
 			sifs = AR5K_INIT_SIFS_DEFAULT_A;
 		break;