diff mbox

ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

Message ID 20131105202034.GC3949@elgon.mountain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter Nov. 5, 2013, 8:20 p.m. UTC
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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sujith Manoharan Nov. 6, 2013, 5:19 a.m. UTC | #1
Dan Carpenter wrote:
> 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')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 74f452c..7ad4e11 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Carpenter Nov. 6, 2013, 6:50 a.m. UTC | #2
On Wed, Nov 06, 2013 at 10:49:21AM +0530, Sujith Manoharan wrote:
> Dan Carpenter wrote:
> > 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')
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> > index 74f452c..7ad4e11 100644
> > --- a/drivers/net/wireless/ath/ath9k/main.c
> > +++ b/drivers/net/wireless/ath/ath9k/main.c
> > @@ -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 ?
> 

Yeah.  That's fine.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 74f452c..7ad4e11 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -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;