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]
Message-ID: <20210205092032.3cyymzvkp5nkiok3@archlinux>
Date:   Fri, 5 Feb 2021 14:50:32 +0530
From:   Amey Narkhede <ameynarkhede02@...il.com>
To:     Nathan Chancellor <nathan@...nel.org>
Cc:     netdev@...r.kernel.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: qlge/qlge_main: Use min_t instead of min

On 21/02/04 03:58PM, Nathan Chancellor wrote:
> On Fri, Feb 05, 2021 at 03:24:51AM +0530, ameynarkhede02@...il.com wrote:
> > From: Amey Narkhede <ameynarkhede02@...il.com>
> >
> > Use min_t instead of min function in qlge/qlge_main.c
> > Fixes following checkpatch.pl warning:
> > WARNING: min() should probably be min_t(int, MAX_CPUS, num_online_cpus())
> >
> > Signed-off-by: Amey Narkhede <ameynarkhede02@...il.com>
> > ---
> >  drivers/staging/qlge/qlge_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> > index 402edaeff..29606d1eb 100644
> > --- a/drivers/staging/qlge/qlge_main.c
> > +++ b/drivers/staging/qlge/qlge_main.c
> > @@ -3938,7 +3938,7 @@ static int ql_configure_rings(struct ql_adapter *qdev)
> >  	int i;
> >  	struct rx_ring *rx_ring;
> >  	struct tx_ring *tx_ring;
> > -	int cpu_cnt = min(MAX_CPUS, (int)num_online_cpus());
> > +	int cpu_cnt = min_t(int, MAX_CPUS, (int)num_online_cpus());
>
> You should remove the cast on num_online_cpus() like checkpatch
> suggests. min_t adds the cast to int on both of the inputs for you.
>
Thanks. Fixed in v2

Amey

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ