[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7b9198260805230448x56bf3bd1kade6083c141a75f2@mail.gmail.com>
Date: Fri, 23 May 2008 12:48:46 +0100
From: "Tom Spink" <tspink@...il.com>
To: "Uwe Kleine-König" <Uwe.Kleine-Koenig@...i.com>
Cc: "Hans J. Koch" <hjk@...utronix.de>, linux-kernel@...r.kernel.org,
"Greg Kroah-Hartman" <gregkh@...e.de>,
"Jan Altenberg" <jan.altenberg@...utronix.de>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Magnus Damm" <magnus.damm@...il.com>
Subject: Re: [PATCH 1/1] UIO: Add a write() function to enable/disable interrupts
2008/5/23 Uwe Kleine-König <Uwe.Kleine-Koenig@...i.com>:
> Hello Tom,
Hi Uwe,
> Tom Spink wrote:
>> The added benefit is that the code becomes less complex, as you don't
>> have to check buffer sizes and copy the integer from userspace.
> AFAIK this is wrong. You need to copy the integer from userspace in
> uio_ioctl. Actually it's a value coming from user space, so you need to
> do it somewhere.
Not really in this case. It's not a *pointer* to a value in
userspace, so you don't need to copy anything. If it was being used
to point to a memory location holding a value, then yes, it would need
to be copied across. But in this case, it's just being used to pass
across 1 or 0.
For example, look at the drivers/char/tty_ioctl.c file, and see how
they use arg as a simple value. arg doesn't have to be a pointer to
userspace.
> Best regards
> Uwe
--
Tom Spink
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists