From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 727BEC77B72 for ; Sat, 15 Apr 2023 01:28:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbjDOB24 (ORCPT ); Fri, 14 Apr 2023 21:28:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjDOB2y (ORCPT ); Fri, 14 Apr 2023 21:28:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C405040E1; Fri, 14 Apr 2023 18:28:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5CE506450A; Sat, 15 Apr 2023 01:28:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67D26C433D2; Sat, 15 Apr 2023 01:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681522132; bh=uUG02w5CTk2pu7MbMecz7O9Xu7eY0dFcJmlanh3cLkI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RxVMv/1YlIFlLsLS1dxTIIsePbxn3H7U946n43Ybk9yTXqpHdkhsyRncgWRWocH9L vgDqyeIYUzQVilW6N1sQ29GOmBHAX0r3RtF63NLDrK+AyotZO6u/B+VfuGrLJdmXxO 1ayPk8CPjLbAyiqEsT6yf0d/BkfbKIba6BNevRr52y0IFM4STlGUAAqMCy+dE/1Yd6 0u+pfXs+Hr4YQVm65Ov5JhQNCo06T0smwFNLC6YzZVt9O1a7IZGF30oroLfwm1Qtt3 713ikRYeXgKXGt20uX+XaolKCE0A0jsd7Vbfg78Hw84Pu9WL6nETlwoCbPTkPH3/ly Nc/keyrMLaRCA== Date: Fri, 14 Apr 2023 18:28:51 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: Horatiu Vultur , , , , , , Subject: Re: [PATCH net-next] net: lan966x: Fix lan966x_ifh_get Message-ID: <20230414182851.6f776cb7@kernel.org> In-Reply-To: <06722642-f934-db3a-f88e-94263592b216@intel.com> References: <20230414082047.1320947-1-horatiu.vultur@microchip.com> <06722642-f934-db3a-f88e-94263592b216@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.