]> 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>
Thu, 8 Dec 2011 04:32:09 +0000 (15:32 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Dec 2011 05:47:54 +0000 (16:47 +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);