From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EFDBD45CC8; Wed, 13 Nov 2024 04:31:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C35A400D7; Wed, 13 Nov 2024 04:31:32 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 9A288400D6 for ; Wed, 13 Nov 2024 04:31:30 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 60851206AA; Wed, 13 Nov 2024 04:31:30 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] rcu: shift 64-bit constant to avoid implicit 32 to 64 bit conversion Date: Wed, 13 Nov 2024 04:31:28 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F8C9@smartserver.smartshare.dk> In-Reply-To: <1731448959-18046-1-git-send-email-andremue@linux.microsoft.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] rcu: shift 64-bit constant to avoid implicit 32 to 64 bit conversion Thread-Index: Ads1TqkZ3zIG3732Qja3G8V3M8geGgAK6qBA References: <1731448959-18046-1-git-send-email-andremue@linux.microsoft.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Andre Muezerie" , "Honnappa Nagarahalli" Cc: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Andre Muezerie [mailto:andremue@linux.microsoft.com] > Sent: Tuesday, 12 November 2024 23.03 >=20 > ../lib/rcu/rte_rcu_qsbr.c(101): warning C4334: '<<': result of 32-bit > shift implicitly converted to 64 bits (was 64-bit shift intended?) > ../lib/rcu/rte_rcu_qsbr.c(107): warning C4334: '<<': result of 32-bit > shift implicitly converted to 64 bits (was 64-bit shift intended?) > ../lib/rcu/rte_rcu_qsbr.c(145): warning C4334: '<<': result of 32-bit > shift implicitly converted to 64 bits (was 64-bit shift intended?) >=20 > These warnings are being issued by the MSVC compiler. Since the result > is > being stored in a variable of type uint64_t, it makes sense to shift a > 64-bit number instead of shifting a 32-bit number and then having the > compiler to convert the result implicitly to 64 bits. > UINT64_C was used in the fix as it is the portable way to define a 64- > bit > constant (ULL suffix is architecture dependent). >=20 > Signed-off-by: Andre Muezerie > --- As far as I can see, this is also a bugfix: (1 << id), where id =3D thread_id & 0x3f, was incorrect when thread_id > = 0x1f. Please add a Fixes tag, so backporting can be considered. Reviewed-by: Morten Br=F8rup