Re: [PATCH] zoran: Fix a warning on x86_64
Jean Delvare <[email protected]>
| Newsgroups | gmane.comp.video.mjpeg.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Trent, On Thu, 24 May 2007 14:49:04 -0700 (PDT), Trent Piepho wrote: > On Thu, 24 May 2007, Jean Delvare wrote: > > --- linux-2.6.22-rc2.orig/drivers/media/video/zoran_driver.c 2007-05-24 19:18:48.000000000 +0200 > > +++ linux-2.6.22-rc2/drivers/media/video/zoran_driver.c 2007-05-24 19:19:56.000000000 +0200 > > @@ -386,8 +386,8 @@ v4l_fbuffer_alloc (struct file *file) > > virt_to_bus(mem); > > dprintk(4, > > KERN_INFO > > - "%s: Bigphysarea frame %d mem 0x%x (bus: 0x%x)\n", > > - ZR_DEVNAME(zr), i, (unsigned) mem, > > + "%s: Bigphysarea frame %d mem 0x%lx (bus: 0x%x)\n", > > + ZR_DEVNAME(zr), i, (unsigned long) mem, > > (unsigned) virt_to_bus(mem)); > > This isn't quite right. virt_to_bus() returns an unsigned long, not an > unsigned int. It actually makes a difference on the 64-bit archs. There's > no need to cast the pointer to an integer type either, there is the %p code > for printing pointers. > > I think the correct code would be: > > "%s: Bigphysarea frame %d mem %p (bus: 0x%lx)\n", > ZR_DEVNAME(zr), i, mem, virt_to_bus(mem)); My patch wasn't introducing these problems, but I agree we can fix them while we're there and your proposal looks good. Here's an updated patch, thanks. * * * * * Fix the following warning on x86_64: drivers/media/video/zoran_driver.c: In function "v4l_fbuffer_alloc": drivers/media/video/zoran_driver.c:387: warning: cast from pointer to integer of different size Signed-off-by: Jean Delvare <[email protected]> --- drivers/media/video/zoran_driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- linux-2.6.22-rc2.orig/drivers/media/video/zoran_driver.c 2007-05-25 14:37:03.000000000 +0200 +++ linux-2.6.22-rc2/drivers/media/video/zoran_driver.c 2007-05-25 14:44:21.000000000 +0200 @@ -386,9 +386,8 @@ v4l_fbuffer_alloc (struct file *file) virt_to_bus(mem); dprintk(4, KERN_INFO - "%s: Bigphysarea frame %d mem 0x%x (bus: 0x%x)\n", - ZR_DEVNAME(zr), i, (unsigned) mem, - (unsigned) virt_to_bus(mem)); + "%s: Bigphysarea frame %d mem %p (bus: 0x%lx)\n", + ZR_DEVNAME(zr), i, mem, virt_to_bus(mem)); /* Zero out the allocated memory */ memset(fh->v4l_buffers.buffer[i].fbuffer, 0, -- Jean Delvare ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/