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, 14 Apr 2023 18:28:51 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Alexander Lobakin <aleksander.lobakin@...el.com>
Cc:     Horatiu Vultur <horatiu.vultur@...rochip.com>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
        <UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH net-next] net: lan966x: Fix lan966x_ifh_get

On Fri, 14 Apr 2023 19:00:20 +0200 Alexander Lobakin wrote:
> > @@ -608,6 +608,7 @@ static u64 lan966x_ifh_get(u8 *ifh, size_t pos, size_t length)
> >  			val |= (1 << i);  
> 
> Alternatively, you can change that to (pick one that you like the most):
> 
> 			val |= 1ULL << i;
> 			// or
> 			val |= BIT_ULL(i);

	// or 
	(u64)1 << i
	// or, since you're only concerned about sign extension, even
	1U << i

having the correct type of the lval seems cleaner than masking, indeed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ