* [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c
@ 2011-12-20 13:00 Toon Schoenmakers
2011-12-22 6:42 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Toon Schoenmakers @ 2011-12-20 13:00 UTC (permalink / raw)
To: sjakub, gregkh; +Cc: devel, linux-kernel
>From ac6a96cdf890714ec7b8f0e6597f82a49cfbe232 Mon Sep 17 00:00:00 2001
From: Toon Schoenmakers <nighteyes1993@gmail.com>
Date: Tue, 20 Dec 2011 13:52:41 +0100
Subject: [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in
asus_oled.c
Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
---
drivers/staging/asus_oled/asus_oled.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/asus_oled/asus_oled.c
b/drivers/staging/asus_oled/asus_oled.c
index 7bb7da7..e77e4e0 100644
--- a/drivers/staging/asus_oled/asus_oled.c
+++ b/drivers/staging/asus_oled/asus_oled.c
@@ -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);
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c
2011-12-20 13:00 [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c Toon Schoenmakers
@ 2011-12-22 6:42 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2011-12-22 6:42 UTC (permalink / raw)
To: Toon Schoenmakers; +Cc: sjakub, gregkh, devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]
On Tue, Dec 20, 2011 at 02:00:33PM +0100, Toon Schoenmakers wrote:
> >From ac6a96cdf890714ec7b8f0e6597f82a49cfbe232 Mon Sep 17 00:00:00 2001
> From: Toon Schoenmakers <nighteyes1993@gmail.com>
> Date: Tue, 20 Dec 2011 13:52:41 +0100
> Subject: [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in
> asus_oled.c
>
Insufficient patch description.
Patch mangled. Read Documentation/email-clients.txt send it to
yourself, verify that it applies with `git am`.
> Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
> ---
> drivers/staging/asus_oled/asus_oled.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/asus_oled/asus_oled.c
> b/drivers/staging/asus_oled/asus_oled.c
> index 7bb7da7..e77e4e0 100644
> --- a/drivers/staging/asus_oled/asus_oled.c
> +++ b/drivers/staging/asus_oled/asus_oled.c
> @@ -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.
> return -EINVAL;
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-22 6:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 13:00 [PATCH] staging: asus_oled: Fixed checkpatch.pl warnings in asus_oled.c Toon Schoenmakers
2011-12-22 6:42 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox