From nobody Wed May 25 07:07:57 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 08BA71AECE2C for ; Wed, 25 May 2022 07:08:17 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L7Mbh6Rvvz3R4R for ; Wed, 25 May 2022 07:08:16 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-pl1-f178.google.com with SMTP id d22so17807208plr.9 for ; Wed, 25 May 2022 00:08:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7lZshifiu4qUbq80C0mWImWnyYwgpHziJzAr0ZO48q8=; b=yRzMNGnqqf4x/tIaFGzpWS9ZmLq27Il2qhMGBlLtXziIw0edIb6hNuEWNv7ZlbFe3G +K3bsjxcosMUUz3/DIt7G3vRaW3vs9R3h+UqeZSjhDom9CMmKxHrQQ6jjDyBhKZYGK9E A40A2KctMAL1XopbzjDReBfc3CyT0YPSIj9rQq1IBvxwDT3sQrg6rJNwggjPionEqMtX i9JXmSIGGWkeJLTPEIeC54c76zKliTZiOMbZwDVr0IhW6qj573NfZ5yuXXD9Mcbx7Xxd zNkCPwWBVdh64GTrQqS3fgeJ7gn1V80Kw/5dE9TG95F8kZp01owZxDrqVrPAITN9uWPh IiBw== X-Gm-Message-State: AOAM533UdqHYPl5KzTQnptEpOwIzuJnfMCuBrZxOJRt8KibKubjXpHT6 L4kwAzVkZCrhLQrBCACrQpVqZGlZ8NC7Xg== X-Google-Smtp-Source: ABdhPJw9Vnl3yP2U/RqlhwCuS86QAGOxKexF+8ckmJYiObsgQuqNuHKDEg/QmVbykcxkwPLlVez6/A== X-Received: by 2002:a17:902:db0e:b0:163:5b80:42d0 with SMTP id m14-20020a170902db0e00b001635b8042d0mr1434538plx.172.1653462489708; Wed, 25 May 2022 00:08:09 -0700 (PDT) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com. [209.85.216.45]) by smtp.gmail.com with ESMTPSA id j5-20020a170902c3c500b001635f7a54e8sm451713plj.1.2022.05.25.00.08.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 May 2022 00:08:08 -0700 (PDT) Received: by mail-pj1-f45.google.com with SMTP id o10-20020a17090a4e8a00b001df2fcdc165so923780pjh.0 for ; Wed, 25 May 2022 00:08:08 -0700 (PDT) X-Received: by 2002:a17:903:234c:b0:162:50f2:a850 with SMTP id c12-20020a170903234c00b0016250f2a850mr4959861plh.89.1653462488170; Wed, 25 May 2022 00:08:08 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202205250030.24P0UqLa029123@gitrepo.freebsd.org> <2BC7CBC1-6A6A-4D89-9A26-98EF76539EEA@freebsd.org> In-Reply-To: From: Eric Joyner Date: Wed, 25 May 2022 00:07:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: e602a30bb9fc - main - irdma(4): Fix compile error on powerpc64 To: =?UTF-8?B?S29ucmFkIFNld2nFgsWCby1Kb3Blaw==?= Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000041de5b05dfd0bc2f" X-Rspamd-Queue-Id: 4L7Mbh6Rvvz3R4R X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000041de5b05dfd0bc2f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Jessica for the report -- I went with keeping %p and casting twice to a void * as in your first suggestion, and remembered to compile test it on both amd64 and powerpc64 afterwards. :p - Eric On Tue, May 24, 2022 at 10:57 PM Konrad Sewi=C5=82=C5=82o-Jopek wrote: > Jessica is right. > > AMD64 build: > > --- all_subdir_irdma --- > --- irdma_ws.o --- > ctfconvert -L VERSION -g irdma_ws.o > --- all_subdir_ispfw --- > :> export_syms > awk -f /mass/coding/scanme/scanme/vendor/freebsd/sys/conf/kmod_syms.awk > isp_2400.ko.full export_syms | xargs -J% objcopy % isp_2400.ko.full > --- all_subdir_irdma --- > --- icrdma.o --- > /mass/coding/scanme/scanme/vendor/freebsd/sys/modules/irdma/../../dev/ird= ma/icrdma.c:504:24: > error: format specifies type 'void *' but the argument has type > 'bus_space_tag_t' (aka 'unsigned long') [-Werror,-Wformat] > pf_if_d(peer), peer->pci_mem->r_bustag); > ^~~~~~~~~~~~~~~~~~~~~~~ > /mass/coding/scanme/scanme/vendor/freebsd/sys/modules/irdma/../../dev/ird= ma/osdep.h:179:74: > note: expanded from macro 'irdma_pr_info' > #define irdma_pr_info(fmt, args ...) printf("%s: WARN "fmt, __func__, ## > args) > ~~~ > ^~~~ > Regards, > Konrad Sewi=C5=82=C5=82o-Jopek > > > =C5=9Br., 25 maj 2022 o 04:02 Jessica Clarke napisa= =C5=82(a): > >> On 25 May 2022, at 01:30, Eric Joyner wrote: >> > >> > The branch main has been updated by erj: >> > >> > URL: >> https://cgit.FreeBSD.org/src/commit/?id=3De602a30bb9fc7ee041a0e629d0fd2d= b7933ffa32 >> > >> > commit e602a30bb9fc7ee041a0e629d0fd2db7933ffa32 >> > Author: Eric Joyner >> > AuthorDate: 2022-05-25 00:27:29 +0000 >> > Commit: Eric Joyner >> > CommitDate: 2022-05-25 00:30:46 +0000 >> > >> > irdma(4): Fix compile error on powerpc64 >> > >> > Jenkins reports that the type used in a printf() specifier is >> > incorrect, so fix it in order to use the appropriate type. >> > >> > Signed-off-by: Eric Joyner >> > >> > Reported by: Jenkins CI >> > MFC after: 6 days >> > MFC-with: cdcd52d41e246ba1c0fcfad0769bd691487355ef >> > Sponsored by: Intel Corporation >> > --- >> > sys/dev/irdma/icrdma.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c >> > index 7cf441b37648..6867274d1cb8 100644 >> > --- a/sys/dev/irdma/icrdma.c >> > +++ b/sys/dev/irdma/icrdma.c >> > @@ -499,7 +499,7 @@ irdma_probe(struct ice_rdma_peer *peer) >> > struct irdma_handler *hdl; >> > int err =3D 0; >> > >> > - irdma_pr_info("probe: irdma-%s peer=3D%p, peer->pf_id=3D%d, >> peer->ifp=3D%p, peer->ifp->if_dunit=3D%d, peer->pci_mem->r_bustag=3D%lx\= n", >> > + irdma_pr_info("probe: irdma-%s peer=3D%p, peer->pf_id=3D%d, >> peer->ifp=3D%p, peer->ifp->if_dunit=3D%d, peer->pci_mem->r_bustag=3D%p\n= ", >> > irdma_driver_version, peer, peer->pf_id, peer->ifp= , >> > pf_if_d(peer), peer->pci_mem->r_bustag); >> >> It=E2=80=99s an int on i386, a uint64_t on amd64 and a struct bus_space = * on >> all other architectures, so this just trades breaking non-x86 for >> breaking x86. You probably want something like >> >> (void *)(uintptr_t)peer->pci_mem->r_bustag >> >> as something that=E2=80=99ll work everywhere, that or take it the other >> direction and forcefully cast it down to an integer type and print that >> like >> >> (uintmax_t)(uintptr_t)peer->pci_mem->r_bustag >> >> with %jx or just >> >> (uintptr_t)peer->pci_mem->r_bustag >> >> with PRIxPTR, but we rarely use those macros. >> >> Jess >> >> >> --00000000000041de5b05dfd0bc2f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Jessica for the report=C2=A0 -- I = went with keeping %p and casting twice to a void * as in your first suggest= ion, and remembered to compile test it on both amd64 and powerpc64 afterwar= ds. :p

- Eric

On Tue, May 24, 2022 at 1= 0:57 PM Konrad Sewi=C5=82=C5=82o-Jopek <kjopek@gmail.com> wrote:
Jessica is right.

<= /div>
AMD64 build:

--- all_subdir_irdma --= -
--- irdma_ws.o ---
ctfconvert -L VERSION -g irdma_ws.o
--- all_s= ubdir_ispfw ---
:> export_syms
awk -f /mass/coding/scanme/scanme/v= endor/freebsd/sys/conf/kmod_syms.awk isp_2400.ko.full =C2=A0export_syms | x= args -J% objcopy % isp_2400.ko.full
--- all_subdir_irdma ---
--- icrd= ma.o ---
/mass/coding/scanme/scanme/vendor/freebsd/sys/modules/irdma/../= ../dev/irdma/icrdma.c:504:24: error: format specifies type 'void *'= but the argument has type 'bus_space_tag_t' (aka 'unsigned lon= g') [-Werror,-Wformat]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pf_if_d(peer), peer->pci_mem->r_busta= g);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~= ~~~~~~~~~~~~~~
/mass/coding/scanme/scanme/vendor/freebsd/sys/modules/ird= ma/../../dev/irdma/osdep.h:179:74: note: expanded from macro 'irdma_pr_= info'
#define irdma_pr_info(fmt, args ...) printf("%s: WARN &qu= ot;fmt, __func__, ## args)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0~~~ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~
Rega= rds,
Konrad Sewi= =C5=82=C5=82o-Jopek


=C5=9Br., 25 maj 202= 2 o 04:02=C2=A0Jessica Clarke <jrtc27@freebsd.org> napisa=C5=82(a):
On 25 May 2022, at 01:30, Eric J= oyner <erj@FreeBSD.org> wrote:
>
> The branch main has been updated by erj:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3De602a30bb9fc7ee041a0e629d0fd2db7933ffa32<= /a>
>
> commit e602a30bb9fc7ee041a0e629d0fd2db7933ffa32
> Author:=C2=A0 =C2=A0 =C2=A0Eric Joyner <erj@FreeBSD.org>
> AuthorDate: 2022-05-25 00:27:29 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Eric Joyner <erj@FreeBSD.org>
> CommitDate: 2022-05-25 00:30:46 +0000
>
>=C2=A0 =C2=A0 irdma(4): Fix compile error on powerpc64
>
>=C2=A0 =C2=A0 Jenkins reports that the type used in a printf() specifie= r is
>=C2=A0 =C2=A0 incorrect, so fix it in order to use the appropriate type= .
>
>=C2=A0 =C2=A0 Signed-off-by: Eric Joyner <erj@FreeBSD.org>
>
>=C2=A0 =C2=A0 Reported by:=C2=A0 =C2=A0 Jenkins CI
>=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 6 days
>=C2=A0 =C2=A0 MFC-with:=C2=A0 =C2=A0 =C2=A0 =C2=A0cdcd52d41e246ba1c0fcf= ad0769bd691487355ef
>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0Intel Corporation
> ---
> sys/dev/irdma/icrdma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c
> index 7cf441b37648..6867274d1cb8 100644
> --- a/sys/dev/irdma/icrdma.c
> +++ b/sys/dev/irdma/icrdma.c
> @@ -499,7 +499,7 @@ irdma_probe(struct ice_rdma_peer *peer)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0struct irdma_handler *hdl;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0int err =3D 0;
>
> -=C2=A0 =C2=A0 =C2=A0irdma_pr_info("probe: irdma-%s peer=3D%p, pe= er->pf_id=3D%d, peer->ifp=3D%p, peer->ifp->if_dunit=3D%d, peer-= >pci_mem->r_bustag=3D%lx\n",
> +=C2=A0 =C2=A0 =C2=A0irdma_pr_info("probe: irdma-%s peer=3D%p, pe= er->pf_id=3D%d, peer->ifp=3D%p, peer->ifp->if_dunit=3D%d, peer-= >pci_mem->r_bustag=3D%p\n",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0irdma_driver_version, peer, peer->pf_id, peer->ifp,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0pf_if_d(peer), peer->pci_mem->r_bustag);

It=E2=80=99s an int on i386, a uint64_t on amd64 and a struct bus_space * o= n
all other architectures, so this just trades breaking non-x86 for
breaking x86. You probably want something like

=C2=A0 (void *)(uintptr_t)peer->pci_mem->r_bustag

as something that=E2=80=99ll work everywhere, that or take it the other
direction and forcefully cast it down to an integer type and print that
like

=C2=A0 (uintmax_t)(uintptr_t)peer->pci_mem->r_bustag

with %jx or just

=C2=A0 (uintptr_t)peer->pci_mem->r_bustag

with PRIxPTR, but we rarely use those macros.

Jess


--00000000000041de5b05dfd0bc2f--