All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8192u: Simplify if condition
@ 2015-03-04 23:32 Ksenija Stanojevic
  2015-03-05  1:37 ` [Outreachy kernel] " Jes Sorensen
  0 siblings, 1 reply; 8+ messages in thread
From: Ksenija Stanojevic @ 2015-03-04 23:32 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ksenija Stanojevic

This patch simplifies if condition using following Coccinelle script:
@@ bool a; symbol true; @@
(
- a != true
+ !a
|
- a == true
+ a
)
@@ bool a; symbol false; @@
(
- a != false
+ a
|
- a == false
+ !a
)

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c
index b5a26f3..8359705 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -335,7 +335,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
 	if (!priv->up)
 		return -ENETDOWN;
 
-	if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true)
+	if (priv->ieee80211->LinkDetectInfo.bBusyTraffic)
 		return -EAGAIN;
 	if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
 		struct iw_scan_req *req = (struct iw_scan_req *)b;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] Staging: rtl8192u: Simplify if condition.
@ 2015-02-24 20:54 Ksenija Stanojevic
  2015-02-24 21:24 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Ksenija Stanojevic @ 2015-02-24 20:54 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ksenija Stanojevic

Remove unnecessary TRUE statement. Fields bDynamicTxLowPower and
bDynamicTxHighPower are of bool type so such change is correct.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
---
 drivers/staging/rtl8192u/r8190_rtl8256.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.c b/drivers/staging/rtl8192u/r8190_rtl8256.c
index 1868352..e000329 100644
--- a/drivers/staging/rtl8192u/r8190_rtl8256.c
+++ b/drivers/staging/rtl8192u/r8190_rtl8256.c
@@ -225,7 +225,7 @@ void PHY_SetRF8256CCKTxPower(struct net_device *dev, u8 powerlevel)
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	TxAGC = powerlevel;
 
-	if (priv->bDynamicTxLowPower == TRUE) {
+	if (priv->bDynamicTxLowPower) {
 		if (priv->CustomerID == RT_CID_819x_Netcore)
 			TxAGC = 0x22;
 		else
@@ -275,7 +275,7 @@ void PHY_SetRF8256OFDMTxPower(struct net_device *dev, u8 powerlevel)
 			priv->Pwr_Track = writeVal_tmp;
 		}
 
-		if (priv->bDynamicTxHighPower == TRUE) {
+		if (priv->bDynamicTxHighPower) {
 			/*Add by Jacken 2008/03/06
 			 *Emily, 20080613. Set low tx power for both MCS and legacy OFDM
 			 */
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-05 15:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 23:32 [PATCH] Staging: rtl8192u: Simplify if condition Ksenija Stanojevic
2015-03-05  1:37 ` [Outreachy kernel] " Jes Sorensen
2015-03-05 15:58   ` Ksenija Stanojević
  -- strict thread matches above, loose matches on Subject: below --
2015-02-24 20:54 Ksenija Stanojevic
2015-02-24 21:24 ` [Outreachy kernel] " Julia Lawall
2015-02-24 21:35   ` Arnd Bergmann
2015-02-25  6:34     ` Julia Lawall
2015-02-25  6:40     ` Julia Lawall
2015-02-25  7:49       ` Ksenija Stanojević

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.