Re: put_user_byte()

Russell King (rmk@arm.linux.org.uk)
Sat, 13 Apr 2002 09:57:28 +0100


On Thu, Apr 11, 2002 at 07:01:25AM -0400, Brian Gerst wrote:
> Use put_user(val, uaddr).

Correct.

> val must be of type unsigned char (or casted to it).

put_user does not care what value you pass it as val. It only cares
about the type of uaddr. The following are all equivalent as far as
the size of the data type written to user space:

put_user((int)foo, (char *)bar);
put_user((char)foo, (char *)bar);
put_user((long)foo, (char *)bar);

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

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