staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c
PATCH 1/1 staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c
Quoted 1 line
From
ac6a96cdf890714ec7b8f0e6597f82a49cfbe232Mon Sep 17 00:00:00 2001
From: Toon Schoenmakers <[email protected]>
Date: Tue, 20 Dec 2011 13:52:41 +0100
Subject: [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c
---drivers/staging/asus_oled/asus_oled.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0
b/drivers/staging/asus_oled/asus_oled.c index 7bb7da7..e77e4e0 100644
drivers/staging/asus_oled/asus_oled.c +0 -0
@@ -201,7 +201,7 @@ static ssize_t set_enabled(struct device *dev,
struct device_attribute *attr,
struct usb_interface *intf = to_usb_interface(dev); struct asus_oled_dev *odev = usb_get_intfdata(intf); unsigned long value;
- if (strict_strtoul(buf, 10, &value))
+ if (kstrtoul(buf, 10, &value))
return -EINVAL;
enable_oled(odev, value);
@@ -217,7 +217,7 @@ static ssize_t class_set_enabled(struct device *device,
(struct asus_oled_dev *) dev_get_drvdata(device); unsigned long value;
- if (strict_strtoul(buf, 10, &value))
+ if (kstrtoul(buf, 10, &value))
return -EINVAL;
enable_oled(odev, value);
Signature · 1 line
1.7.6.4
Quoted 6 lines · Toon Schoenmakers
Quoted 1 line
From
ac6a96cdf890714ec7b8f0e6597f82a49cfbe232Mon Sep 17 00:00:00 2001From: Toon Schoenmakers <[email protected]>
Date: Tue, 20 Dec 2011 13:52:41 +0100
Subject: [PATCH] staging:asus_oled: Fixed checkpatch.pl warnings inasus_oled.c
Insufficient patch description.
Patch mangled. Read Documentation/email-clients.txt send it to yourself, verify that it applies with git am.
Quoted 11 lines
Signed-off-by Toon Schoenmakers <[email protected]>---
drivers/staging/asus_oled/asus_oled.c| 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)drivers/staging/asus_oled/asus_oled.c +0
-0
drivers/staging/asus_oled/asus_oled.c static ssize_t set_enabled(struct device *dev, · line 205
Quoted 6 lines
drivers/staging/asus_oled/asus_oled.c +1
-1@@ -201,7 +201,7 @@ static ssize_t set_enabled(struct device *dev,struct device_attribute *attr, struct usb_interface *intf = to_usb_interface(dev);struct asus_oled_dev *odev =usb_get_intfdata (intf);unsigned long value; -if (strict_strtoul (buf,10 , &value)) +if (kstrtoul (buf,10 , &value))
We introduced a lot of new functions here so it's not just a one to one translation from the old strict_strtoul(). For example kstrtou8() might be more appropriate here because that's what gets passed to enable_oled(). You would need to change the type for value as well.
Althought it doesn't matter much. If the user passes anything besides 1 or 0, they deserve what they get I suppose.
Preserve the error code instead of returning -EINVAL for everything.
drivers/staging/asus_oled/asus_oled.c static ssize_t set_enabled(struct device *dev, · line 206
Quoted 1 line
drivers/staging/asus_oled/asus_oled.c +0
-0return -EINVAL ;
regards,
dan carpenter