Skip to content

Commit

Permalink
Staging: rtl8187se, rtl8192e: fix '&' vs '|' bugs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent 0cf5755 commit 6fe8644
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8187se/r8180_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6fe8644

Please sign in to comment.