Date: Wed, 25 May 2022 07:56:24 +0200 From: =?UTF-8?B?S29ucmFkIFNld2nFgsWCby1Kb3Blaw==?= <kjopek@gmail.com> To: Jessica Clarke <jrtc27@freebsd.org> Cc: Eric Joyner <erj@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org> Subject: Re: git: e602a30bb9fc - main - irdma(4): Fix compile error on powerpc64 Message-ID: <CAGgez=K3-=KjhPYPw7sReMcsTHY%2BjLYPT4Fkh_E-OYUshQZHRg@mail.gmail.com> In-Reply-To: <2BC7CBC1-6A6A-4D89-9A26-98EF76539EEA@freebsd.org> References: <202205250030.24P0UqLa029123@gitrepo.freebsd.org> <2BC7CBC1-6A6A-4D89-9A26-98EF76539EEA@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <jrtc27@freebsd.org> napisa=C5= =82(a): > On 25 May 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=3De602a30bb9fc7ee041a0e629d0fd2db= 7933ffa32 > > > > commit e602a30bb9fc7ee041a0e629d0fd2db7933ffa32 > > Author: Eric Joyner <erj@FreeBSD.org> > > AuthorDate: 2022-05-25 00:27:29 +0000 > > Commit: Eric Joyner <erj@FreeBSD.org> > > 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 <erj@FreeBSD.org> > > > > 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 <div dir=3D"ltr"><div>Jessica is right.</div><div><br></div><div>AMD64 buil= d:<br></div><div><br></div><div>--- all_subdir_irdma ---<br>--- irdma_ws.o = ---<br>ctfconvert -L VERSION -g irdma_ws.o<br>--- all_subdir_ispfw ---<br>:= > export_syms<br>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<br>--- all_subdir_irdma ---<br>--- icrdma.o ---<br>/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]<br>=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);<br>=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^~~~~~~~~~~~~~~~~~~~~~~<br>= /mass/coding/scanme/scanme/vendor/freebsd/sys/modules/irdma/../../dev/irdma= /osdep.h:179:74: note: expanded from macro 'irdma_pr_info'<br>#defi= ne irdma_pr_info(fmt, args ...) printf("%s: WARN "fmt, __func__, = ## args)<br>=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 ^~~~</div><div>Regards,<br></div><di= v><div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_s= ignature"><div dir=3D"ltr"><div>Konrad Sewi=C5=82=C5=82o-Jopek</div></div><= /div></div><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">=C5=9Br., 25 maj 2022 o 04:02=C2=A0Jessica Clarke <= <a href=3D"mailto:jrtc27@freebsd.org">jrtc27@freebsd.org</a>> napisa=C5= =82(a):<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px = 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 25 Ma= y 2022, at 01:30, Eric Joyner <erj@FreeBSD.org> wrote:<br> > <br> > The branch main has been updated by erj:<br> > <br> > URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3De602a30bb9fc= 7ee041a0e629d0fd2db7933ffa32" rel=3D"noreferrer" target=3D"_blank">https://= cgit.FreeBSD.org/src/commit/?id=3De602a30bb9fc7ee041a0e629d0fd2db7933ffa32<= /a><br> > <br> > commit e602a30bb9fc7ee041a0e629d0fd2db7933ffa32<br> > Author:=C2=A0 =C2=A0 =C2=A0Eric Joyner <erj@FreeBSD.org><br> > AuthorDate: 2022-05-25 00:27:29 +0000<br> > Commit:=C2=A0 =C2=A0 =C2=A0Eric Joyner <erj@FreeBSD.org><br> > CommitDate: 2022-05-25 00:30:46 +0000<br> > <br> >=C2=A0 =C2=A0 irdma(4): Fix compile error on powerpc64<br> > <br> >=C2=A0 =C2=A0 Jenkins reports that the type used in a printf() specifie= r is<br> >=C2=A0 =C2=A0 incorrect, so fix it in order to use the appropriate type= .<br> > <br> >=C2=A0 =C2=A0 Signed-off-by: Eric Joyner <erj@FreeBSD.org><br> > <br> >=C2=A0 =C2=A0 Reported by:=C2=A0 =C2=A0 Jenkins CI<br> >=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 6 days<br> >=C2=A0 =C2=A0 MFC-with:=C2=A0 =C2=A0 =C2=A0 =C2=A0cdcd52d41e246ba1c0fcf= ad0769bd691487355ef<br> >=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0Intel Corporation<br> > ---<br> > sys/dev/irdma/icrdma.c | 2 +-<br> > 1 file changed, 1 insertion(+), 1 deletion(-)<br> > <br> > diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c<br> > index 7cf441b37648..6867274d1cb8 100644<br> > --- a/sys/dev/irdma/icrdma.c<br> > +++ b/sys/dev/irdma/icrdma.c<br> > @@ -499,7 +499,7 @@ irdma_probe(struct ice_rdma_peer *peer)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0struct irdma_handler *hdl;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0int err =3D 0;<br> > <br> > -=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",<br> > +=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",<br> >=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,<br> >=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);<br> <br> It=E2=80=99s an int on i386, a uint64_t on amd64 and a struct bus_space * o= n<br> all other architectures, so this just trades breaking non-x86 for<br> breaking x86. You probably want something like<br> <br> =C2=A0 (void *)(uintptr_t)peer->pci_mem->r_bustag<br> <br> as something that=E2=80=99ll work everywhere, that or take it the other<br> direction and forcefully cast it down to an integer type and print that<br> like<br> <br> =C2=A0 (uintmax_t)(uintptr_t)peer->pci_mem->r_bustag<br> <br> with %jx or just<br> <br> =C2=A0 (uintptr_t)peer->pci_mem->r_bustag<br> <br> with PRIxPTR, but we rarely use those macros.<br> <br> Jess<br> <br> <br> </blockquote></div> --000000000000e15d8305dfcfbde5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGgez=K3-=KjhPYPw7sReMcsTHY%2BjLYPT4Fkh_E-OYUshQZHRg>