[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230414182851.6f776cb7@kernel.org>
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