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] [day] [month] [year] [list]
Message-ID: <5c940a6c29674b2986e4e9be1c2e4b39@AcuMS.aculab.com>
Date:   Sat, 1 Apr 2023 18:20:54 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Eric Dumazet' <edumazet@...gle.com>,
        Alexander Lobakin <aleksander.lobakin@...el.com>
CC:     Arnd Bergmann <arnd@...nel.org>, Jakub Kicinski <kuba@...nel.org>,
        "Arnd Bergmann" <arnd@...db.de>,
        "David S. Miller" <davem@...emloft.net>,
        "Paolo Abeni" <pabeni@...hat.com>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        "Jason Xing" <kerneljasonxing@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] net: netcp: MAX_SKB_FRAGS is now 'int'

From: Eric Dumazet
> Sent: 31 March 2023 17:58
....
> > I'd personally define %MAX_SKB_FRAGS as `(u32)CONFIG_MAX_SKB_FRAGS`.
> > It can't be below zero or above %U32_MAX and we have to define it
> > manually anyway, so why not cast to the type expected from it :D
> >
> 
> Some files have the assumption MAX_SKB_FRAGS can be understood by the
> C preprocessor.
> 
> #if MAX_SKB_FRAGS > 32

...

You could use:
#define MAX_SKB_FRAGS (CONFIG_MAX_SKB_FRAGS + 0u)
to force the type to be 'unsigned int' while still leaving
a value that cpp groks.
(Or add 0ul to get the type back? to 'unsigned long'.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ