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]
Message-ID: <CAKgT0UfZ5k6PrV=hpx_vr6K5fDcO-n2Kp7QeXdeX4N8k1vCb3w@mail.gmail.com>
Date: Tue, 25 Jun 2024 09:07:06 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, Alexander Duyck <alexanderduyck@...com>, kuba@...nel.org, 
	davem@...emloft.net, pabeni@...hat.com
Subject: Re: [net-next PATCH v2 04/15] eth: fbnic: Add register init to set
 PCIe/Ethernet device config

On Tue, Jun 25, 2024 at 8:01 AM Andrew Lunn <andrew@...n.ch> wrote:
>
> A nitpick:
>
> > +#define CSR_BIT(nr)          (1u << (nr))
>
> Isn't that just
>
> #define CSR_BIT(nr)             BIT(nr)
>
> which makes me wounder why bother? Why not just use BIT()?
>
>         Andrew

Actually BIT is an unsigned long, whereas this should be just a 32b
unsigned int. The general idea is that CSR is a 32b value and
shouldn't be extended to 64b. With this if we mess up somewhere and
define an out of bounds bit it should generate an error about us
shifting the value out of bounds.

Thanks,

- Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ