[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101028115531.GG11937@mail.oracle.com>
Date: Thu, 28 Oct 2010 04:55:32 -0700
From: Joel Becker <Joel.Becker@...cle.com>
To: Dan Carpenter <error27@...il.com>,
Randy Dunlap <rdunlap@...otime.net>,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [patch v2] configfs: documentation: remove unneeded check
On Wed, Oct 27, 2010 at 04:50:31PM +0200, Dan Carpenter wrote:
> If "p" is NULL then it will cause an oops when we pass it to
> simple_strtoul(). In this case "p" can not be NULL so I removed the
> check. I also changed the check a little to make it more explicit that
> we are testing whether p points to the NUL char.
>
> Signed-off-by: Dan Carpenter <error27@...il.com>
Acked-by: Joel Becker <joel.becker@...cle.com>
> ---
> V2: Added some parenthesis to make the precedence more clear.
>
> diff --git a/Documentation/filesystems/configfs/configfs_example_explicit.c b/Documentation/filesystems/configfs/configfs_example_explicit.c
> index d428cc9..63ff248 100644
> --- a/Documentation/filesystems/configfs/configfs_example_explicit.c
> +++ b/Documentation/filesystems/configfs/configfs_example_explicit.c
> @@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(struct childless *childless,
> char *p = (char *) page;
>
> tmp = simple_strtoul(p, &p, 10);
> - if (!p || (*p && (*p != '\n')))
> + if ((*p != '\0') && (*p != '\n'))
> return -EINVAL;
>
> if (tmp > INT_MAX)
>
--
"Sometimes I think the surest sign intelligent
life exists elsewhere in the universe is that
none of it has tried to contact us."
-Calvin & Hobbes
Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker@...cle.com
Phone: (650) 506-8127
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists