Staging: rtl8187se, rtl8192e: fix '&' vs '|' bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 9 Jun 2012 17:05:16 +0000 (20:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2012 17:52:32 +0000 (10:52 -0700)
The original code is equivalent to:

wrqu->retry.flags = 0x1000 & 0x0002;

so it just sets .flags to zero.  We should be ORing the values together
like r8192_wx_get_retry() does in drivers/staging/rtl8192u/r8192U_wx.c.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8187se/r8180_wx.c
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

index 46ee6f47f5251908163c4c65a8665cb50ef27391..52f63d75d248028664a849b35a1ea92ec1a84441 100644 (file)
@@ -615,10 +615,10 @@ static int r8180_wx_get_retry(struct net_device *dev,
                return -EINVAL;
 
        if (wrqu->retry.flags & IW_RETRY_MAX) {
-               wrqu->retry.flags = IW_RETRY_LIMIT & IW_RETRY_MAX;
+               wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
                wrqu->retry.value = priv->retry_rts;
        } else {
-               wrqu->retry.flags = IW_RETRY_LIMIT & IW_RETRY_MIN;
+               wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
                wrqu->retry.value = priv->retry_data;
        }
 
index 778d7baf8e08eb67d079a3ab34a265e1cdc70a3c..6202358c2984fc0c5e1597783790df60b97835bd 100644 (file)
@@ -919,10 +919,10 @@ static int r8192_wx_get_retry(struct net_device *dev,
                return -EINVAL;
 
        if (wrqu->retry.flags & IW_RETRY_MAX) {
-               wrqu->retry.flags = IW_RETRY_LIMIT & IW_RETRY_MAX;
+               wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
                wrqu->retry.value = priv->retry_rts;
        } else {
-               wrqu->retry.flags = IW_RETRY_LIMIT & IW_RETRY_MIN;
+               wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
                wrqu->retry.value = priv->retry_data;
        }
        return 0;