lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 14 May 2022 10:54:45 -0700
From:   Joe Perches <joe@...ches.com>
To:     Martin Kaiser <martin@...ser.cx>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Larry Finger <Larry.Finger@...inger.net>,
        Phillip Potter <phil@...lpotter.co.uk>,
        Michael Straube <straube.linux@...il.com>,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] staging: r8188eu: replace if with ternary operator

On Sat, 2022-05-14 at 18:47 +0200, Martin Kaiser wrote:
> Replace an if statement with a ternary operator, making the code a tiny
> bit shorter.
[]
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
[]
> @@ -1503,10 +1503,8 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
>  		preorder_ctrl->indicate_seq = 0xffff;
>  		preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq;
>  
> -		if (pmlmeinfo->bAcceptAddbaReq)
> -			issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 0);
> -		else
> -			issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 37);/* reject ADDBA Req */
> +		issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP,
> +				pmlmeinfo->bAcceptAddbaReq ? 0 : 37);

Seems like magic numbers.  Maybe add/use defines?


Powered by blists - more mailing lists