From nobody Wed May 25 05:56:24 2022 X-Original-To: dev-commits-src-all@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 C45261B4DFCE; Wed, 25 May 2022 05:57:13 +0000 (UTC) (envelope-from kjopek@gmail.com) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 4L7L1b30h0z3GNH; Wed, 25 May 2022 05:57:07 +0000 (UTC) (envelope-from kjopek@gmail.com) Received: by mail-il1-x12b.google.com with SMTP id t13so6324058ilm.9; Tue, 24 May 2022 22:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YFto7LGaLrtsu5xfosmsyXdWZihx/KMSj+IDGnsBdV8=; b=mvbYA/+FtOSO4OEDyrOYvnBeEuRV8lMcmBwWU+VxKQpMJzarntkLIeTGMPHzdbqF4W YqRVPSqSWMh4mjkfjsSE2XefFqFgA2xeNMhze1+jqmGgm0cD7fboyb+ONrk2/UHBde5R c/PSiDfrpm9XFPFd1QTMqeaA2AXw4yvfD2vdbAvH+bkd33FkwNLATDFl0Ly7AhXvnZgT uMVHZbWQMB8BCkjve0s3xcA6K104gPX5bTCqtU3U90RAPlTfabJql5Ww1oRcr5fZbHFa 6a17H5GLXUGNkLhaZ+/ii1Kpfm9O4Ca3K35zvT1mQGulae+5al6QBXggu6x+p6uW+Jkx A5Cg== 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=YFto7LGaLrtsu5xfosmsyXdWZihx/KMSj+IDGnsBdV8=; b=ZlWro8VDzBvZziR2B1VZnpi1ucItqqmH4UGLxw03xSXn3iWKM5GxLQ2sBK8oO2jLky boDHlrAlFootUa6/D6itnkme3Ig2eY+5whbz2/bw6e6jnSXdAqfp1s+I9TdmpXH1ObCK yS8Ek+SynNoyM7eF9IbdkFtONBz2tP1Zu11JjCumWqb3SVEDSEVaJx277ydGRe97FOtJ oQIrPFSb1ybQQtl6upsJNIkYx71jdYSzy4JEXmaqCbXd0fueyl6VIPUDBAdK7W8nnCdr +YQb25TTWPSRewifGJVWZGW0AVPxmVsr0rzjCHqdjzEgh5aMMqUUNwIrWCrzFNuXTUBt 96aw== X-Gm-Message-State: AOAM531gUd18BgNTMwUgqGCQIs/H8ZUBP93ZueJeFG3T2wBLTdP2XCJ5 dJMhVv7mD/APE22REfQLQ1FhwqPgdO1xT31dP7VaHpplpQ2q X-Google-Smtp-Source: ABdhPJzx75ui5OQ+/AHySelMwuFkjf6PZndW9C3bLY/VQrwfV6M8Q03r+kHmoBUFa8DAQ1DBFsSgZELctolPXigLr1o= X-Received: by 2002:a05:6e02:1a67:b0:2d1:b8de:4cd4 with SMTP id w7-20020a056e021a6700b002d1b8de4cd4mr5488973ilv.120.1653458220439; Tue, 24 May 2022 22:57:00 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202205250030.24P0UqLa029123@gitrepo.freebsd.org> <2BC7CBC1-6A6A-4D89-9A26-98EF76539EEA@freebsd.org> In-Reply-To: <2BC7CBC1-6A6A-4D89-9A26-98EF76539EEA@freebsd.org> From: =?UTF-8?B?S29ucmFkIFNld2nFgsWCby1Kb3Blaw==?= Date: Wed, 25 May 2022 07:56:24 +0200 Message-ID: Subject: Re: git: e602a30bb9fc - main - irdma(4): Fix compile error on powerpc64 To: Jessica Clarke Cc: Eric Joyner , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000e15d8305dfcfbde5" X-Rspamd-Queue-Id: 4L7L1b30h0z3GNH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000e15d8305dfcfbde5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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/irdma= /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/irdma= /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=3De602a30bb9fc7ee041a0e629d0fd2db= 7933ffa32 > > > > 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 > > > --000000000000e15d8305dfcfbde5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Jessica is right.

AMD64 buil= d:

--- 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/co= nf/kmod_syms.awk isp_2400.ko.full =C2=A0export_syms | xargs -J% objcopy % i= sp_2400.ko.full
--- all_subdir_irdma ---
--- icrdma.o ---
/mass/co= ding/scanme/scanme/vendor/freebsd/sys/modules/irdma/../../dev/irdma/icrdma.= c:504:24: error: format specifies type 'void *' but the argument ha= s type 'bus_space_tag_t' (aka 'unsigned long') [-Werror,-Wf= ormat]
=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_bustag);
=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/irdma/../../dev/irdma= /osdep.h:179:74: note: expanded from macro 'irdma_pr_info'
#defi= ne irdma_pr_info(fmt, args ...) printf("%s: WARN "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 ^~~~
Regards,
Konrad Sewi=C5=82=C5=82o-Jopek
<= /div>


=C5=9Br., 25 maj 2022 o 04:02=C2=A0Jessica Clarke <= jrtc27@freebsd.org> napisa=C5= =82(a):
On 25 Ma= y 2022, at 01:30, Eric Joyner <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


--000000000000e15d8305dfcfbde5--