Re: + drivers-acpi-apei-erst-dbgc-get_useru64-doesnt-work-on-i386.patchadded to -mm tree
From: H. Peter Anvin
Date: Thu Aug 12 2010 - 02:11:24 EST
On 08/11/2010 11:03 PM, Andrew Morton wrote:
<I suspect you can do get_user() on a 4-byte or 8-byte struct right now
and it'll work>
Not so:
/home/hpa/kernel/linux-2.6-tip.urgent/arch/x86/lib/testuser.c:12: error:
conversion to non-scalar type requested
-hpa
#include <linux/types.h>
#include <linux/uaccess.h>
struct foo {
u16 a, b;
};
int bluttan(struct foo *foo)
{
struct foo bar;
if (get_user(bar, foo))
return -1;
return bar.a + bar.b;
}