All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Nazarewicz" <mina86@mina86.com>
To: akpm@linux-foundation.org, "Alexey Dobriyan" <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [40/52] kstrtox: convert drivers/usb/
Date: Thu, 14 Apr 2011 12:31:35 +0200	[thread overview]
Message-ID: <op.vtxbiwjx3l0zgt@mnazarewicz-glaptop> (raw)
In-Reply-To: <1296915654-7458-40-git-send-email-adobriyan@gmail.com>

On Sat, 05 Feb 2011 15:20:43 +0100, Alexey Dobriyan <adobriyan@gmail.com>  
wrote:

> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>
> ---
> drivers/usb/gadget/storage_common.c |    7 ++++---

I haven't notice your patch (wasn't sent to linux-usb?) and changed this
file already -- patch is in Greg's tree.

>  drivers/usb/host/ehci-dbg.c         |    6 +++---
>  drivers/usb/serial/iuu_phoenix.c    |   27 ++++++++++-----------------
>  3 files changed, 17 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/usb/gadget/storage_common.c  
> b/drivers/usb/gadget/storage_common.c
> index b015561..ed81718 100644
> --- a/drivers/usb/gadget/storage_common.c
> +++ b/drivers/usb/gadget/storage_common.c
> @@ -713,8 +713,9 @@ static ssize_t fsg_store_ro(struct device *dev,  
> struct device_attribute *attr,
>  	struct rw_semaphore	*filesem = dev_get_drvdata(dev);
>  	unsigned long	ro;
> -	if (strict_strtoul(buf, 2, &ro))
> -		return -EINVAL;
> +	rc = kstrtoul(buf, 2, &ro);
> +	if (rc < 0)
> +		return rc;
> 	/*
>  	 * Allow the write-enable status to change only while the

Also, this is actually incorrect -- it zeroes rc which it should not
do.  I made the same mistake at first. ;)

> @@ -740,7 +741,7 @@ static ssize_t fsg_store_nofua(struct device *dev,
>  	struct fsg_lun	*curlun = fsg_lun_from_dev(dev);
>  	unsigned long	nofua;
> -	if (strict_strtoul(buf, 2, &nofua))
> +	if (kstrtoul(buf, 2, &nofua))
>  		return -EINVAL;
> 	/* Sync data when switching from async mode to sync */


> diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
> @@ -1000,7 +1000,7 @@ static ssize_t debug_lpm_write(struct file *file,  
> const char __user *user_buf,
>  		buf[len - 1] = '\0';
> 	if (strncmp(buf, "enable", 5) == 0) {
> -		if (strict_strtoul(buf + 7, 10, &port))
> +		if (kstrtoul(buf + 7, 10, &port))
>  			return -EINVAL;
>  		params = ehci_readl(ehci, &ehci->caps->hcs_params);
>  		if (port > HCS_N_PORTS(params)) {
> @@ -1018,7 +1018,7 @@ static ssize_t debug_lpm_write(struct file *file,  
> const char __user *user_buf,
>  		printk(KERN_INFO "force enable LPM for port %lu\n", port);
>  	} else if (strncmp(buf, "hird=", 5) == 0) {
>  		unsigned long hird;
> -		if (strict_strtoul(buf + 5, 16, &hird))
> +		if (kstrtoul(buf + 5, 16, &hird))
>  			return -EINVAL;
>  		printk(KERN_INFO "setting hird %s %lu\n", buf + 6, hird);
>  		temp = ehci_readl(ehci, &ehci->regs->command);
> @@ -1026,7 +1026,7 @@ static ssize_t debug_lpm_write(struct file *file,  
> const char __user *user_buf,
>  		temp |= hird << 24;
>  		ehci_writel(ehci, temp, &ehci->regs->command);
>  	} else if (strncmp(buf, "disable", 7) == 0) {
> -		if (strict_strtoul(buf + 8, 10, &port))
> +		if (kstrtoul(buf + 8, 10, &port))
>  			return -EINVAL;
>  		params = ehci_readl(ehci, &ehci->caps->hcs_params);
>  		if (port > HCS_N_PORTS(params)) {

I'm wondering if we care about loosing the possible -ERANGE.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@google.com>-----ooO--(_)--Ooo--

  reply	other threads:[~2011-04-14 10:31 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-05 14:20 [PATCH 01/52] kstrtox: converting strings to integers done (hopefully) right Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 02/52] kstrtox: convert kernel/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 03/52] kstrtox: convert kernel/trace/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 04/52] kstrtox: convert mm/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 05/52] kstrtox: convert block/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 06/52] kstrtox: convert security/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 07/52] kstrtox: convert fs/fuse/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 08/52] kstrtox: convert fs/nfs/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 09/52] kstrtox: convert fs/proc/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 10/52] kstrtox: convert drivers/acpi/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 11/52] kstrtox: convert drivers/ata/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 12/52] kstrtox: convert drivers/base/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 13/52] kstrtox: convert drivers/block/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 14/52] kstrtox: convert drivers/bluetooth/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 15/52] kstrtox: convert drivers/clocksource/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 16/52] kstrtox: convert drivers/edac/ Alexey Dobriyan
2011-02-05 17:34   ` Borislav Petkov
2011-02-06 18:52     ` Alexey Dobriyan
2011-02-07  9:43       ` Borislav Petkov
2011-02-05 14:20 ` [PATCH 17/52] kstrtox: convert drivers/gpio/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 18/52] kstrtox: convert drivers/gpu/drm/nouveau/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 19/52] kstrtox: convert drivers/hid/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 20/52] kstrtox: convert drivers/hwmon/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 21/52] kstrtox: convert drivers/ide/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 22/52] kstrtox: convert drivers/infiniband/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 23/52] kstrtox: convert drivers/input/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 24/52] kstrtox: convert drivers/isdn/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 25/52] kstrtox: convert drivers/leds/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 26/52] kstrtox: convert drivers/macintosh/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 27/52] kstrtox: convert drivers/md/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 28/52] kstrtox: convert drivers/mfd/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 29/52] kstrtox: convert drivers/misc/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 30/52] kstrtox: convert drivers/mmc/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 31/52] kstrtox: convert drivers/net/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 32/52] kstrtox: convert drivers/net/wireless/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 33/52] kstrtox: convert drivers/pci/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 34/52] kstrtox: convert drivers/power/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 35/52] kstrtox: convert drivers/regulator/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 36/52] kstrtox: convert drivers/rtc/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 37/52] kstrtox: convert drivers/scsi/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 38/52] kstrtox: convert drivers/ssb/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 39/52] kstrtox: convert drivers/target/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 40/52] kstrtox: convert drivers/usb/ Alexey Dobriyan
2011-04-14 10:31   ` Michal Nazarewicz [this message]
2011-02-05 14:20 ` [PATCH 41/52] kstrtox: convert drivers/video/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 42/52] kstrtox: convert drivers/w1/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 43/52] kstrtox: convert sound/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 44/52] kstrtox: convert net/ Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 45/52] kstrtox: convert arm Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 46/52] kstrtox: convert microblaze Alexey Dobriyan
2011-02-10 13:55   ` Michal Simek
2011-02-05 14:20 ` [PATCH 47/52] kstrtox: convert mips Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 48/52] kstrtox: convert powerpc Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 49/52] kstrtox: convert s390 Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 50/52] kstrtox: convert tile Alexey Dobriyan
2011-02-05 14:20 ` [PATCH 51/52] kstrtox: convert x86 Alexey Dobriyan
2011-02-05 14:33 ` [PATCH 01/52] kstrtox: converting strings to integers done (hopefully) right Geert Uytterhoeven
2011-02-05 14:40   ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.vtxbiwjx3l0zgt@mnazarewicz-glaptop \
    --to=mina86@mina86.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.