diff options
| author | Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2004-07-13 19:37:04 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-13 19:37:04 -0700 |
| commit | 790d43fd412fbb30bfb61504250e88ece790f485 (patch) | |
| tree | d129747d615470a10c45d2ada3386f593e66b5dd /drivers/block | |
| parent | c659d1a85a24500b775390a0d5f6a2fe06d6cbf4 (diff) | |
[PATCH] sparse: read_descriptor_t annotation
We have a fun situation with read_descriptor_t - all its instances end
up passed to some actor; these actors use desc->buf as their private
data; there are 5 of them and they expect resp:
struct lo_read_data *
struct svc_rqst *
struct file *
struct rpc_xprt *
char __user *
IOW, there is no type safety whatsoever; the field is essentially untyped,
we rely on the fact that actor is chosen by the same code that sets ->buf
and expect it to put something of the right type there.
Right now desc->buf is declared as char __user *. Moreover, the last
argument of ->sendfile() (what should be stored in ->buf) is void __user *,
even though it's actually _never_ a userland pointer.
If nothing else, ->sendfile() should take void * instead; that alone removes
a bunch of bogus warnings. I went further and replaced desc->buf with a
union of void * and char __user *.
Diffstat (limited to 'drivers/block')
| -rw-r--r-- | drivers/block/loop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index f1250943c167..946742912a9f 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -293,7 +293,7 @@ lo_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset, unsigned long size) { unsigned long count = desc->count; - struct lo_read_data *p = (struct lo_read_data*)desc->buf; + struct lo_read_data *p = desc->arg.data; struct loop_device *lo = p->lo; sector_t IV; |
