]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-fix
authorAndrew Morton <akpm@linux-foundation.org>
Fri, 16 Dec 2011 04:49:28 +0000 (15:49 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 19 Dec 2011 07:19:14 +0000 (18:19 +1100)
fix sscanf checking

Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Daniel Drake <dsd@laptop.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/platform/olpc/olpc-xo15-sci.c

index 649230c6979f7a65d3ff0c3e1ec0d42dd5801831..2dd700351e7a5d4ed913fc382e64440b7108072e 100644 (file)
@@ -58,7 +58,8 @@ static ssize_t lid_wake_on_close_store(struct kobject *s,
                                       const char *buf, size_t n)
 {
        unsigned int val;
-       if (!sscanf(buf, "%u", &val) == 1)
+
+       if (sscanf(buf, "%u", &val) != 1)
                return -EINVAL;
 
        set_lid_wake_behavior(!!val);