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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Jul 2021 18:22:35 +0100
From:   Salah Triki <salah.triki@...il.com>
To:     Steffen Maier <maier@...ux.ibm.com>
Cc:     aacraid@...rosemi.com, "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        gregkh@...uxfoundation.org, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RESEND] scsi: aacraid: aachba: replace if with max()

On Fri, Jul 23, 2021 at 06:56:51PM +0200, Steffen Maier wrote:
> On 7/22/21 7:32 PM, Salah Triki wrote:
> > Replace if with max() in order to make code more clean.
> > 
> > Signed-off-by: Salah Triki <salah.triki@...il.com>
> > ---
> >   drivers/scsi/aacraid/aachba.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
> > index 46b8dffce2dd..330224f08fd3 100644
> > --- a/drivers/scsi/aacraid/aachba.c
> > +++ b/drivers/scsi/aacraid/aachba.c
> > @@ -485,8 +485,8 @@ int aac_get_containers(struct aac_dev *dev)
> >   	if (status != -ERESTARTSYS)
> >   		aac_fib_free(fibptr);
> > 
> > -	if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS)
> > -		maximum_num_containers = MAXIMUM_NUM_CONTAINERS;
> > +	maximum_num_containers = max(maximum_num_containers, MAXIMUM_NUM_CONTAINERS);
> > +
> 
> Haven't really looked closely, but isn't the old code more like a min()
> rather than a max()? maximum_num_containers being at least
> MAXIMUM_NUM_CONTAINERS or higher?
> 

In the old code, maximum_num_containers gets the value MAXIMUM_NUM_CONTAINERS if
it is less than this value.

Thanx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ