Re: [PATCH] Kill a sparse warning in binfmt_elf.c

From: David S. Miller
Date: Thu Oct 07 2004 - 14:32:47 EST


On Thu, 07 Oct 2004 14:54:57 -0400
Valdis.Kletnieks@xxxxxx wrote:

> > dump_write() is a static function without a prototype.
>
> static int dump_write(struct file *file, const char __user *addr, int nr)
> {
> return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
> }
>
> And then go find the callers and make sure what they're passing is a
> 'const char __user *' rather than a 'const void *'....

The caller's aren't, that is the point. They run dump_write()
with set_fs(KERNEL_DS), which allows kernel pointers to be treated
as user ones in system call handling paths, which is why the cast
is needed somewhere.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/