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 C236945DE4; Fri, 6 Dec 2024 17:43:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 591384064F; Fri, 6 Dec 2024 17:43:49 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 5637C4027D for ; Fri, 6 Dec 2024 17:43:48 +0100 (CET) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Y4cWS1l9Cz6LDFR; Sat, 7 Dec 2024 00:43:00 +0800 (CST) Received: from frapeml500006.china.huawei.com (unknown [7.182.85.219]) by mail.maildlp.com (Postfix) with ESMTPS id 4B53E1404F5; Sat, 7 Dec 2024 00:43:47 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500006.china.huawei.com (7.182.85.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 6 Dec 2024 17:43:47 +0100 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.039; Fri, 6 Dec 2024 17:43:47 +0100 From: Konstantin Ananyev To: Konstantin Ananyev , Andre Muezerie CC: "dev@dpdk.org" Subject: RE: [PATCH v3 2/7] drivers/bus: eliminate dependency on non-portable __SIZEOF_LONG__ Thread-Topic: [PATCH v3 2/7] drivers/bus: eliminate dependency on non-portable __SIZEOF_LONG__ Thread-Index: AQHbRs0Y6QGjt0urKEqnv0iA47FtLbLZJIoQgAAyUgCAABaMUIAAAM4Q Date: Fri, 6 Dec 2024 16:43:46 +0000 Message-ID: <9da5f24b33434c798b5f9be35aeb6615@huawei.com> References: <1733342995-3722-2-git-send-email-andremue@linux.microsoft.com> <1733372429-3996-1-git-send-email-andremue@linux.microsoft.com> <1733372429-3996-3-git-send-email-andremue@linux.microsoft.com> <20241206161924.GA26543@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <6cff1c5a700842d79c19b045fb1f5bb8@huawei.com> In-Reply-To: <6cff1c5a700842d79c19b045fb1f5bb8@huawei.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.73] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > -----Original Message----- > From: Konstantin Ananyev > Sent: Friday, December 6, 2024 4:41 PM > To: Andre Muezerie > Cc: dev@dpdk.org > Subject: RE: [PATCH v3 2/7] drivers/bus: eliminate dependency on non-port= able __SIZEOF_LONG__ >=20 >=20 > > > > Macro __SIZEOF_LONG__ is not standardized and MSVC does not define = it. > > > > Therefore the errors below are seen with MSVC: > > > > > > > > ../lib/mldev/mldev_utils_scalar.c(465): error C2065: > > > > '__SIZEOF_LONG__': undeclared identifier > > > > ../lib/mldev/mldev_utils_scalar.c(478): error C2051: > > > > case expression not constant > > > > > > > > ../lib/mldev/mldev_utils_scalar_bfloat16.c(33): error C2065: > > > > '__SIZEOF_LONG__': undeclared identifier > > > > ../lib/mldev/mldev_utils_scalar_bfloat16.c(49): error C2051: > > > > case expression not constant > > > > > > > > Turns out that the places where __SIZEOF_LONG__ is currently > > > > being used can equally well use sizeof(long) instead. > > > > > > > > Signed-off-by: Andre Muezerie > > > > --- > > > > drivers/bus/fslmc/mc/fsl_mc_cmd.h | 3 +-- > > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/bus/fslmc/mc/fsl_mc_cmd.h b/drivers/bus/fslmc/= mc/fsl_mc_cmd.h > > > > index a768774c89..f27a18905d 100644 > > > > --- a/drivers/bus/fslmc/mc/fsl_mc_cmd.h > > > > +++ b/drivers/bus/fslmc/mc/fsl_mc_cmd.h > > > > @@ -29,9 +29,8 @@ > > > > #define le32_to_cpu rte_le_to_cpu_32 > > > > #define le16_to_cpu rte_le_to_cpu_16 > > > > > > > > -#define BITS_PER_LONG (__SIZEOF_LONG__ * 8) > > > > #define GENMASK(h, l) \ > > > > - (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) > > > > + (((~0UL) << (l)) & (~0UL >> (RTE_BITS_PER_LONG - 1 - (h)))) > > > > > > Inside > > > There are macros: RTE_GENMASK64 (and RTE_GENMASK32). > > > Which as I understand does same thing. > > > Might be better to just use these ones instead of hand-crafting > > > same thing over different PMDs. > > > > > > > I agree. I can submit a separate patch for that once this series aimed = at > > unblocking MSVC from being used on this code goes in, if that is OK. If > > instead you feel strongly that this change should be made as part of th= is > > series let me know. >=20 > I am fine anyway. Sorry meant to say: I am fine either way. :) =20 > Just thought that doing something like: > #define GENMASK(h, l) RTE_GENMASK64(h, l) > Would be less work for you and less code churn. >=20 > > -- > > Andre Muezerie > > > > > > > > > > struct mc_cmd_header { > > > > union { > > > > -- > > > > 2.47.0.vfs.0.3