From nobody Wed May 25 07:07:57 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 08B831AECCE2 for ; Wed, 25 May 2022 07:08:17 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 4L7Mbh69n9z3QxT for ; Wed, 25 May 2022 07:08:16 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-pj1-f47.google.com with SMTP id m14-20020a17090a414e00b001df77d29587so905774pjg.2 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=d8dmVM26KZ5V/n8qImCN6XxanEQbrOQf3ai9EVD4tZQo0+UfwnGnPpd4R1Rb7qC6yz gyqUaqRY+LtA2yAcafeF3u/fyQl0b+S0Q8OE+ehr0Q+dRD9rC6dtBfvvw8i7KEmGrtV+ GOh3YTy7qp1Zg2ADX08fVAu2uH2Hxp7ZvBoRV7XUzsqbC4+PskZjiybEdHoxZ9xcKc1e DpBgeQhgn539R11cRl0CH1HL3oHTXlUAdaSUJG4Bi9PhtdYpySg5lgtha4stBVckrLLQ p5aPww3XL6Tm7nbamNTttWyZtpkTCqi1oDwZu48qq8yYP24xG/o8+IeR+0awp5vrc+qU B74A== X-Gm-Message-State: AOAM531EROpF8epl/rq/67oqK7+SAc4jAOOPWPPb7YYEVdbPDNA72KqB ogz3Od+zYZAVK0rxFS8dxYcyp27okb137Q== X-Google-Smtp-Source: ABdhPJzNxvqFIwxjjmV/gc9KlV7DDT6hspETX7zLKCYAEPpHRDfeu7mguvV887GbQngrDG6/NZOq4A== X-Received: by 2002:a17:90b:3ecd:b0:1dc:945e:41b1 with SMTP id rm13-20020a17090b3ecd00b001dc945e41b1mr8881760pjb.208.1653462489834; Wed, 25 May 2022 00:08:09 -0700 (PDT) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com. [209.85.216.54]) by smtp.gmail.com with ESMTPSA id g12-20020a170902c98c00b0015e8d4eb20bsm8340172plc.85.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-f54.google.com with SMTP id ob14-20020a17090b390e00b001dff2a43f8cso3227465pjb.1 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 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: 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: 4L7Mbh69n9z3QxT 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--