From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751437AbbIMFc6 (ORCPT ); Sun, 13 Sep 2015 01:32:58 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:11833 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbbIMFc5 (ORCPT ); Sun, 13 Sep 2015 01:32:57 -0400 X-IronPort-AV: E=Sophos;i="5.17,521,1437429600"; d="scan'208";a="145589995" Date: Sun, 13 Sep 2015 07:32:53 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Shraddha Barke cc: Greg Kroah-Hartman , Jes Sorensen , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] Staging: rtl8188eu: Bool tests don't need comparisons In-Reply-To: Message-ID: References: <1442079123-7475-1-git-send-email-shraddha.6596@gmail.com> <1442079123-7475-3-git-send-email-shraddha.6596@gmail.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-761842003-1442122374=:2057" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-761842003-1442122374=:2057 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 13 Sep 2015, Shraddha Barke wrote: > > > On Sat, Sep 12, 2015 at 11:07 PM, Julia Lawall > wrote: > > > On Sat, 12 Sep 2015, Shraddha Barke wrote: > > > This patch removes comparisons to true/false values on bool > variables. > > > > Changes in v3- > >  Fix made manually > > > > Signed-off-by: Shraddha Barke > > --- > >  drivers/staging/rtl8188eu/core/rtw_cmd.c       | 12 > +++++------ > >  drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 > +++++++++++++------------- > >  2 files changed, 20 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c > b/drivers/staging/rtl8188eu/core/rtw_cmd.c > > index 001a2f3..591ac5d 100644 > > --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c > > +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c > > @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter  > *padapter, struct ndis_802_11_ssid *ssid, > >       struct cmd_priv         *pcmdpriv = &padapter->cmdpriv; > >       struct mlme_priv        *pmlmepriv = > &padapter->mlmepriv; > > > > -     if (check_fwstate(pmlmepriv, _FW_LINKED) == true) > > +     if (check_fwstate(pmlmepriv, _FW_LINKED)) > >               rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, > 1); > > > >       ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); > > @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct > adapter *padapter, u8 *pbuf, int sz) > >       pmlmepriv = &(padapter->mlmepriv); > > > >  #ifdef CONFIG_88EU_AP_MODE > > -     if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) > > +     if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) > >               expire_timeout_chk(padapter); > >  #endif > > > > @@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct > adapter *padapter, u8 lps_ctrl_type) > >       u8      mstatus; > > > > > > -     if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) > == true) || > > -         (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == > true)) > > +     if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) > || > > +         (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) > > You don't need to keep the parentheses. > > julia > > I don't see extra parentheses. Aren't all of them needed to improve > readability? You have basically ((foo(1,2,3)) || (foo(4,5,6))) I don't think that is more readable than (foo(1,2,3) || foo(4,5,6)) Actually, the parentheses weren't really needed before, but they are even less useful now. julia --8323328-761842003-1442122374=:2057--