Skip to contentSkip to conversation

ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

PATCH New Dan Carpenter 2 participants 3 messages Nov 5, 2013 – Nov 6, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

SC_OP_INVALID is zero so the test is always false. We're supposed to be testing the lowest bit instead.

Fixes 89f927af7f33 ('ath9k: add TX99 support')
drivers/net/wireless/ath/ath9k/main.c +1 -1
index 74f452c..7ad4e11 100644
@@ -2456,7 +2456,7 @@ int ath9k_tx99_init(struct ath_softc *sc)
 	struct ath_tx_control txctl;
 	int r;
 
-	if (sc->sc_flags & SC_OP_INVALID) {
+	if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
 		ath_err(common,
 			"driver is in invalid state unable to use TX99");
 		return -EINVAL;
#1 lore raw

PATCH 1/1 ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

Quoted 11 lines · Dan Carpenter

SC_OP_INVALID is zero so the test is always false. We're supposed to be testing the lowest bit instead.

Fixes 89f927af7f33 ('ath9k: add TX99 support')
drivers/net/wireless/ath/ath9k/main.c +0 -0
index 74f452c..7ad4e11 100644

drivers/net/wireless/ath/ath9k/main.c int ath9k_tx99_init(struct ath_softc *sc) · line 2462

Quoted 8 lines
drivers/net/wireless/ath/ath9k/main.c +1 -1
@@ -2456,7 +2456,7 @@ int ath9k_tx99_init(struct ath_softc *sc)
 	struct ath_tx_control txctl;
 	int r;
 
-	if (sc->sc_flags & SC_OP_INVALID) {
+	if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
 		ath_err(common,
 			"driver is in invalid state unable to use TX99");
 		return -EINVAL;

Nice catch.

The tx99 code in ath9k has been moved to a separate file, is it okay if I adopt this patch and update it ?

Sujith

#2 lore raw

PATCH 1/1 ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

Quoted 23 lines · Sujith Manoharan
Quoted 11 lines · Dan Carpenter

SC_OP_INVALID is zero so the test is always false. We're supposed to be testing the lowest bit instead.

Fixes 89f927af7f33 ('ath9k: add TX99 support')
drivers/net/wireless/ath/ath9k/main.c +0 -0
index 74f452c..7ad4e11 100644

drivers/net/wireless/ath/ath9k/main.c int ath9k_tx99_init(struct ath_softc *sc) · line 2462

Quoted 8 lines
drivers/net/wireless/ath/ath9k/main.c +1 -1
@@ -2456,7 +2456,7 @@ int ath9k_tx99_init(struct ath_softc *sc)
 	struct ath_tx_control txctl;
 	int r;
 
-	if (sc->sc_flags & SC_OP_INVALID) {
+	if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
 		ath_err(common,
 			"driver is in invalid state unable to use TX99");
 		return -EINVAL;

Nice catch.

Quoted 3 lines

The tx99 code in ath9k has been moved to a separate file, is it okay if I adopt this patch and update it ?

Yeah. That's fine.

regards,
dan carpenter