Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2022 00:07:57 -0700
From:      Eric Joyner <erj@freebsd.org>
To:        =?UTF-8?B?S29ucmFkIFNld2nFgsWCby1Kb3Blaw==?= <kjopek@gmail.com>
Cc:        Jessica Clarke <jrtc27@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:  <CAKdFRZhuAhPOr9jF_Gyw4LZMTDJACkTJuCJC5EciJ6jV51KCZg@mail.gmail.com>
In-Reply-To: <CAGgez=K3-=KjhPYPw7sReMcsTHY%2BjLYPT4Fkh_E-OYUshQZHRg@mail.gmail.com>
References:  <202205250030.24P0UqLa029123@gitrepo.freebsd.org> <2BC7CBC1-6A6A-4D89-9A26-98EF76539EEA@freebsd.org> <CAGgez=K3-=KjhPYPw7sReMcsTHY%2BjLYPT4Fkh_E-OYUshQZHRg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <kjopek@gma=
il.com>
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 <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=3De602a30bb9fc7ee041a0e629d0fd2d=
b7933ffa32
>> >
>> > 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
>>
>>
>>

--00000000000041de5b05dfd0bc2f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">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</div><div dir=3D"ltr"><br></div><div>- Eric</div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, May 24, 2022 at 1=
0:57 PM Konrad Sewi=C5=82=C5=82o-Jopek &lt;<a href=3D"mailto:kjopek@gmail.c=
om">kjopek@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr"><div>Jessica is right.</div><div><br><=
/div><div>AMD64 build:<br></div><div><br></div><div>--- all_subdir_irdma --=
-<br>--- irdma_ws.o ---<br>ctfconvert -L VERSION -g irdma_ws.o<br>--- all_s=
ubdir_ispfw ---<br>:&gt; export_syms<br>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<br>--- all_subdir_irdma ---<br>--- icrd=
ma.o ---<br>/mass/coding/scanme/scanme/vendor/freebsd/sys/modules/irdma/../=
../dev/irdma/icrdma.c:504:24: error: format specifies type &#39;void *&#39;=
 but the argument has type &#39;bus_space_tag_t&#39; (aka &#39;unsigned lon=
g&#39;) [-Werror,-Wformat]<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-&gt;pci_mem-&gt;r_busta=
g);<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/ird=
ma/../../dev/irdma/osdep.h:179:74: note: expanded from macro &#39;irdma_pr_=
info&#39;<br>#define irdma_pr_info(fmt, args ...) printf(&quot;%s: WARN &qu=
ot;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>Rega=
rds,<br></div><div><div><div dir=3D"ltr"><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 202=
2 o 04:02=C2=A0Jessica Clarke &lt;<a href=3D"mailto:jrtc27@freebsd.org" tar=
get=3D"_blank">jrtc27@freebsd.org</a>&gt; napisa=C5=82(a):<br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">On 25 May 2022, at 01:30, Eric J=
oyner &lt;erj@FreeBSD.org&gt; wrote:<br>
&gt; <br>
&gt; The branch main has been updated by erj:<br>
&gt; <br>
&gt; 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>
&gt; <br>
&gt; commit e602a30bb9fc7ee041a0e629d0fd2db7933ffa32<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Eric Joyner &lt;erj@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2022-05-25 00:27:29 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Eric Joyner &lt;erj@FreeBSD.org&gt;<br>
&gt; CommitDate: 2022-05-25 00:30:46 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 irdma(4): Fix compile error on powerpc64<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 Jenkins reports that the type used in a printf() specifie=
r is<br>
&gt;=C2=A0 =C2=A0 incorrect, so fix it in order to use the appropriate type=
.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 Signed-off-by: Eric Joyner &lt;erj@FreeBSD.org&gt;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 Reported by:=C2=A0 =C2=A0 Jenkins CI<br>
&gt;=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 6 days<br>
&gt;=C2=A0 =C2=A0 MFC-with:=C2=A0 =C2=A0 =C2=A0 =C2=A0cdcd52d41e246ba1c0fcf=
ad0769bd691487355ef<br>
&gt;=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0Intel Corporation<br>
&gt; ---<br>
&gt; sys/dev/irdma/icrdma.c | 2 +-<br>
&gt; 1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c<br>
&gt; index 7cf441b37648..6867274d1cb8 100644<br>
&gt; --- a/sys/dev/irdma/icrdma.c<br>
&gt; +++ b/sys/dev/irdma/icrdma.c<br>
&gt; @@ -499,7 +499,7 @@ irdma_probe(struct ice_rdma_peer *peer)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0struct irdma_handler *hdl;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0int err =3D 0;<br>
&gt; <br>
&gt; -=C2=A0 =C2=A0 =C2=A0irdma_pr_info(&quot;probe: irdma-%s peer=3D%p, pe=
er-&gt;pf_id=3D%d, peer-&gt;ifp=3D%p, peer-&gt;ifp-&gt;if_dunit=3D%d, peer-=
&gt;pci_mem-&gt;r_bustag=3D%lx\n&quot;,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0irdma_pr_info(&quot;probe: irdma-%s peer=3D%p, pe=
er-&gt;pf_id=3D%d, peer-&gt;ifp=3D%p, peer-&gt;ifp-&gt;if_dunit=3D%d, peer-=
&gt;pci_mem-&gt;r_bustag=3D%p\n&quot;,<br>
&gt;=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-&gt;pf_id, peer-&gt;ifp,<br>
&gt;=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-&gt;pci_mem-&gt;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-&gt;pci_mem-&gt;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-&gt;pci_mem-&gt;r_bustag<br>
<br>
with %jx or just<br>
<br>
=C2=A0 (uintptr_t)peer-&gt;pci_mem-&gt;r_bustag<br>
<br>
with PRIxPTR, but we rarely use those macros.<br>
<br>
Jess<br>
<br>
<br>
</blockquote></div>
</blockquote></div></div>

--00000000000041de5b05dfd0bc2f--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKdFRZhuAhPOr9jF_Gyw4LZMTDJACkTJuCJC5EciJ6jV51KCZg>