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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VegJ+DgG1g2PJ0WQMUFpMrt1aJOb_NgvzL90NsuD_Oosg@mail.gmail.com>
Date: Thu, 3 Apr 2025 08:26:58 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
Cc: outreachy@...ts.linux.dev, julia.lawall@...ia.fr, hdegoede@...hat.com, 
	mchehab@...nel.org, sakari.ailus@...ux.intel.com, andy@...nel.org, 
	gregkh@...uxfoundation.org, linux-staging@...ts.linux.dev, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] staging: rtl8723bs: Prevent duplicate NULL tests on a value

On Thu, Apr 3, 2025 at 2:30 AM Abraham Samuel Adekunle
<abrahamadekunle50@...il.com> wrote:
>
> When a value has been tested for NULL in an expression, a
> second NULL test on the same value in another expression
> is unnecessary when the value has not been assigned NULL.
>
> Remove unnecessary duplicate NULL tests on the same value that
> has previously been NULL tested.
>
> Found by Coccinelle

...

> -                       if (psta) {
> +                       {
>                                 psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
>                                 psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF;
>                                 pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority];

Same comment, shift left and remove pointless {} altogether.


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ