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: <CAFo17Pj2oi1fdgc=ypKZj+J0H8A4uettkk=trzq--9qe_8QYaQ@mail.gmail.com>
Date:   Thu, 3 Mar 2022 09:38:10 +0800
From:   lotte bai <baihaowen88@...il.com>
To:     Heiner Kallweit <hkallweit1@...il.com>
Cc:     sebastian.hesselbarth@...il.com, davem@...emloft.net,
        kuba@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: marvell: Use min() instead of doing it manually

Yes, I have compiled at local, either unsigned and U is pass.  Thank
you for your kindly reminder.

Heiner Kallweit <hkallweit1@...il.com> 于2022年3月2日周三 19:06写道:
>
> On 02.03.2022 07:48, Haowen Bai wrote:
> > Fix following coccicheck warning:
> > drivers/net/ethernet/marvell/mv643xx_eth.c:1664:35-36: WARNING opportunity for min()
> >
> > Signed-off-by: Haowen Bai <baihaowen88@...il.com>
> > ---
> >  drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> > index 143ca8b..e3e79cf 100644
> > --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> > +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> > @@ -1661,7 +1661,7 @@ mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er,
> >       if (er->rx_mini_pending || er->rx_jumbo_pending)
> >               return -EINVAL;
> >
> > -     mp->rx_ring_size = er->rx_pending < 4096 ? er->rx_pending : 4096;
> > +     mp->rx_ring_size = min(er->rx_pending, (unsigned)4096);
>
> Don't just use unsigned w/o int. Why not simply marking the constant as unsigned: 4096U ?
> And again: You should at least compile-test it.
>
> >       mp->tx_ring_size = clamp_t(unsigned int, er->tx_pending,
> >                                  MV643XX_MAX_SKB_DESCS * 2, 4096);
> >       if (mp->tx_ring_size != er->tx_pending)
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ