lkml.org 
[lkml]   [2010]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + drivers-acpi-apei-erst-dbgc-get_useru64-doesnt-work-on-i386.patch added to -mm tree
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;
}
\
 
 \ /
  Last update: 2010-08-12 08:13    [W:0.055 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site