Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbbDCQmR (ORCPT ); Fri, 3 Apr 2015 12:42:17 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:32992 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbbDCQmQ (ORCPT ); Fri, 3 Apr 2015 12:42:16 -0400 Date: Fri, 3 Apr 2015 22:12:11 +0530 From: Amitoj Kaur Chawla To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] Staging: rtl8188eu: Remove zero testing pointer typed value Message-ID: <20150403164211.GA6422@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2085 Lines: 92 Removes variable comparison with 0 by using !. Done using following coccinelle script. @ disable is_zero,isnt_zero @ expression *E; expression E1,f; @@ E = f(...) <... ( - E == 0 + !E | - E != 0 + E | - 0 == E + !E | - 0 != E + E ) ...> ?E = E1 @ disable is_zero,isnt_zero @ expression *E; @@ ( E == - 0 + NULL | E != - 0 + NULL | - 0 + NULL == E | - 0 + NULL != E ) Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/rtl8188eu/hal/odm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c index 28b5e7b..bc2dca4 100644 --- a/drivers/staging/rtl8188eu/hal/odm.c +++ b/drivers/staging/rtl8188eu/hal/odm.c @@ -650,7 +650,7 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm) } else { /* Recovery mechanism for IGI lower bound */ - if (pDM_DigTable->Recover_cnt != 0) { + if (pDM_DigTable->Recover_cnt) { pDM_DigTable->Recover_cnt--; } else { if (pDM_DigTable->LargeFAHit < 3) { @@ -851,7 +851,7 @@ void ODM_RF_Saving(struct odm_dm_struct *pDM_Odm, u8 bForceInNormal) Rssi_Up_bound = 50; Rssi_Low_bound = 45; } - if (pDM_PSTable->initialize == 0) { + if (!pDM_PSTable->initialize) { pDM_PSTable->Reg874 = (phy_query_bb_reg(adapter, 0x874, bMaskDWord)&0x1CC000)>>14; pDM_PSTable->RegC70 = (phy_query_bb_reg(adapter, 0xc70, bMaskDWord)&BIT3)>>3; pDM_PSTable->Reg85C = (phy_query_bb_reg(adapter, 0x85c, bMaskDWord)&0xFF000000)>>24; @@ -1180,7 +1180,7 @@ void odm_RSSIMonitorCheckCE(struct odm_dm_struct *pDM_Odm) } } - if (tmpEntryMaxPWDB != 0) /* If associated entry is found */ + if (tmpEntryMaxPWDB) /* If associated entry is found */ pdmpriv->EntryMaxUndecoratedSmoothedPWDB = tmpEntryMaxPWDB; else pdmpriv->EntryMaxUndecoratedSmoothedPWDB = 0; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/