Date: Sat, 14 Apr 2012 18:27:37 -0700 From: Garrett Cooper <yanegomi@gmail.com> To: Luigi Rizzo <luigi@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234290 - head/sys/dev/netmap Message-ID: <26482E9C-4636-4820-AD24-5F5642E5D0A5@gmail.com> In-Reply-To: <201204141644.q3EGiJ3h038632@svn.freebsd.org> References: <201204141644.q3EGiJ3h038632@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 14, 2012, at 9:44 AM, Luigi Rizzo wrote: > Author: luigi > Date: Sat Apr 14 16:44:18 2012 > New Revision: 234290 > URL: http://svn.freebsd.org/changeset/base/234290 >=20 > Log: > i prefer this fix for the -Wformat warning (just one cast, > all the other variables are already correct for %x). > My previous attempt put the cast in the wrong place. >=20 > Modified: > head/sys/dev/netmap/netmap_mem2.c >=20 > Modified: head/sys/dev/netmap/netmap_mem2.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/netmap/netmap_mem2.c Sat Apr 14 16:42:17 2012 = (r234289) > +++ head/sys/dev/netmap/netmap_mem2.c Sat Apr 14 16:44:18 2012 = (r234290) > @@ -161,11 +161,9 @@ netmap_ofstophys(vm_offset_t offset) > return p[i]->lut[offset / p[i]->_objsize].paddr + > offset % p[i]->_objsize; > } > - D("invalid ofs 0x%jx out of 0x%jx 0x%jx 0x%jx", (uintmax_t)o, > - (uintmax_t)p[0]->_memtotal, > - (uintmax_t)(p[0]->_memtotal + p[1]->_memtotal), > - (uintmax_t)(p[0]->_memtotal + p[1]->_memtotal + > - p[2]->_memtotal)); > + D("invalid ofs 0x%x out of 0x%x 0x%x 0x%x", (u_int)o, > + p[0]->_memtotal, p[0]->_memtotal + p[1]->_memtotal, > + p[0]->_memtotal + p[1]->_memtotal + p[2]->_memtotal); > return 0; // XXX bad address > } As I mentioned before in private email, wouldn't it make more = sense to make `"%x=85", (u_int)o` into `%lx=85`, o because vm_offset_t = is uint32_t on 32-bit archs and uint64_t on 64-bit archs? What's done = above truncates the represented value for 64-bit archs. Thanks! -Garrett=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?26482E9C-4636-4820-AD24-5F5642E5D0A5>