DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wambui Karuga <wambui.karugax@gmail.com>
Cc: devel@driverdev.osuosl.org, outreachy-kernel@googlegroups.com,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH 3/4] staging: rtl8723bs: Remove comparisons to booleans in conditionals.
Date: Thu, 10 Oct 2019 11:57:55 +0300
Message-ID: <20191010085755.GD20470@kadam> (raw)
In-Reply-To: <4af8981347a05f0a25fa1540d8753e7040ea2d85.1570678371.git.wambui.karugax@gmail.com>

On Thu, Oct 10, 2019 at 06:39:23AM +0300, Wambui Karuga wrote:
>  	if (is_primary_adapter(adapter))
>  		DBG_871X("IsBtDisabled =%d, IsBtControlLps =%d\n", hal_btcoex_IsBtDisabled(adapter), hal_btcoex_IsBtControlLps(adapter));
>  
> -	if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode == true)
> -		&& (hal_btcoex_IsBtControlLps(adapter) == false)
> +	if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode)
> +		&& !(hal_btcoex_IsBtControlLps(adapter))

Delete the extra parentheses as well, because they don't make sense when
we remove the == false comparison.  It's part of doing "one thing" is to
the whole thing and not leave bits undone.

		&& !hal_btcoex_IsBtControlLps(adapter)

>  		) {
>  		u8 bEnterPS;
>  
> @@ -2047,7 +2047,7 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
>  
>  
>  	/* check bssid, if needed */
> -	if (mlme->assoc_by_bssid == true) {
> +	if (mlme->assoc_by_bssid) {
>  		if (memcmp(competitor->network.MacAddress, mlme->assoc_bssid, ETH_ALEN))
>  			goto exit;
>  	}
> @@ -2805,7 +2805,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
>  	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
>  	u8 cbw40_enable = 0;
>  
> -
>  	if (!phtpriv->ht_option)
>  		return;
>  
> @@ -2815,7 +2814,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
>  	DBG_871X("+rtw_update_ht_cap()\n");
>  
>  	/* maybe needs check if ap supports rx ampdu. */
> -	if ((phtpriv->ampdu_enable == false) && (pregistrypriv->ampdu_enable == 1)) {
> +	if (!(phtpriv->ampdu_enable) && pregistrypriv->ampdu_enable == 1) {

Same.

>  		if (pregistrypriv->wifi_spec == 1) {
>  			/* remove this part because testbed AP should disable RX AMPDU */
>  			/* phtpriv->ampdu_enable = false; */

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  3:39 [PATCH 0/4] Fix style and formatting issues in rtw_mlme.c Wambui Karuga
2019-10-10  3:39 ` [PATCH 1/4] staging: rtl8723bs: Remove comparisons to NULL in conditionals Wambui Karuga
2019-10-10  3:39 ` [PATCH 2/4] staging: rtl8723bs: Remove unnecessary braces for single statements Wambui Karuga
2019-10-10  3:39 ` [PATCH 3/4] staging: rtl8723bs: Remove comparisons to booleans in conditionals Wambui Karuga
2019-10-10  8:57   ` Dan Carpenter [this message]
2019-10-10  3:39 ` [PATCH 4/4] staging: rtl8723bs: Remove unnecessary blank lines Wambui Karuga

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191010085755.GD20470@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=wambui.karugax@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git