X-GM-THRID: 6205086344963686400 X-Received: by 10.112.142.195 with SMTP id ry3mr6943854lbb.22.1444735216911; Tue, 13 Oct 2015 04:20:16 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.180.107.10 with SMTP id gy10ls923491wib.14.gmail; Tue, 13 Oct 2015 04:20:16 -0700 (PDT) X-Received: by 10.194.118.65 with SMTP id kk1mr6870275wjb.5.1444735216447; Tue, 13 Oct 2015 04:20:16 -0700 (PDT) Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id i8si114388wib.1.2015.10.13.04.20.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 04:20:16 -0700 (PDT) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.17,677,1437429600"; d="scan'208";a="182534529" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Oct 2015 13:20:16 +0200 Date: Tue, 13 Oct 2015 13:20:13 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Shivani Bhardwaj cc: outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH 2/2] Staging: wilc1000: wilc_wfi_cfgoperations: Change variable to bool In-Reply-To: <20f17185a553556d1d6d806811bf068cd727a689.1444733999.git.shivanib134@gmail.com> Message-ID: References: <20f17185a553556d1d6d806811bf068cd727a689.1444733999.git.shivanib134@gmail.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 13 Oct 2015, Shivani Bhardwaj wrote: > Change variable of the type u8 to bool as the only values acquired by it > are true or false. This looks better, but now I think that PMKID_FOUND is not used anywhere, so its definition can be removed. julia > Signed-off-by: Shivani Bhardwaj > --- > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > index d2e6f55..e4c134a 100644 > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > @@ -1714,7 +1714,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev, > { > u32 i; > s32 s32Error = 0; > - u8 flag = 0; > + bool pmkid_found = false; > > struct wilc_priv *priv = wiphy_priv(wiphy); > > @@ -1725,7 +1725,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev, > if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid, > ETH_ALEN)) { > /*If bssid already exists and pmkid value needs to reset*/ > - flag = PMKID_FOUND; > + pmkid_found = true; > PRINT_D(CFG80211_DBG, "PMKID already exists\n"); > break; > } > @@ -1736,7 +1736,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev, > ETH_ALEN); > memcpy(priv->pmkid_list.pmkidlist[i].pmkid, pmksa->pmkid, > PMKID_LEN); > - if (!(flag == PMKID_FOUND)) > + if (!pmkid_found) > priv->pmkid_list.numpmkid++; > } else { > PRINT_ER("Invalid PMKID index\n"); > -- > 2.1.0 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20f17185a553556d1d6d806811bf068cd727a689.1444733999.git.shivanib134%40gmail.com. > For more options, visit https://groups.google.com/d/optout. >