lkml.org 
[lkml]   [2008]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] Werror: Fix casting wrong size integer to pointer
On Thu, 29 May 2008 19:17:26 +0100 David Howells <dhowells@redhat.com> wrote:

> --- a/drivers/message/i2o/i2o_config.c
> +++ b/drivers/message/i2o/i2o_config.c
> @@ -886,7 +886,7 @@ static int i2o_cfg_passthru(unsigned long arg)
> flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
> // TODO 64bit fix
> if (copy_from_user
> - (p, (void __user *)sg[i].addr_bus,
> + (p, (void __user *)(unsigned long)sg[i].addr_bus,
> sg_size)) {
> printk(KERN_DEBUG
> "%s: Could not copy SG buf %d FROM user\n",
> @@ -942,7 +942,7 @@ static int i2o_cfg_passthru(unsigned long arg)
> sg_size = sg[j].flag_count & 0xffffff;
> // TODO 64bit fix
> if (copy_to_user
> - ((void __user *)sg[j].addr_bus, sg_list[j],
> + ((void __user *)(unsigned long)sg[j].addr_bus, sg_list[j],
> sg_size)) {
> printk(KERN_WARNING
> "%s: Could not copy %p TO user %x\n",

yup, what Linus said. This one's been irritating me for years, and I
got close to tempting Markus into fixing it before he departed the
scene. But it remains, as a little "might be busted on 64 bit" reminder.


\
 
 \ /
  Last update: 2008-05-29 21:23    [W:0.180 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site