public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver
Date: Wed, 23 Nov 2011 17:11:01 -0500	[thread overview]
Message-ID: <201111231711.02187.vapier@gentoo.org> (raw)
In-Reply-To: <3A9F4839-B299-4A7A-9618-423D8E8BDD82@delien.nl>

On Wednesday 23 November 2011 04:51:45 Robert Deli?n wrote:
> +       if (name[0] >= '0' && name[0] <= '9') {
> +               pin_nr = simple_strtoul(name, (char **)&name, 10);
> +               if (name[0])
> +                       return -EINVAL;
> 
> Why do we need this check ? We have already copied / converted the
> number in pin_nr, we do not need to check in the string again. And you
> do not need to update name, because you are returning in any case.
> 
> This check checks if name pointer - after it's updated by simple_strtoul -
> points to the terminating NULL character. If if does, name contained a
> valid number. If it doesn't, it's pointing to trailing garbage and hence
> name didn't contain a valid number. In other words; This checks prevents a
> string like 3kjh;khji being interpreted as 3.

your client apparently lacks proper quoting.  please do something about this.  
it's fairly difficult to figure out what you're saying and what you're quoting.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111123/d06133c8/attachment.pgp>

      reply	other threads:[~2011-11-23 22:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 15:40 [U-Boot] [PATCH] M28: Added pin name support in GPIO driver Robert Deliën
2011-11-22 18:28 ` Marek Vasut
2011-11-22 19:13   ` Robert Deliën
2011-11-22 19:32     ` Marek Vasut
2011-11-22 20:49       ` Robert Deliën
2011-11-22 22:18         ` Mike Frysinger
2011-11-22 22:37           ` Marek Vasut
2011-11-23 10:08             ` Robert Deliën
2011-11-23 22:18             ` Mike Frysinger
2011-11-22 21:10 ` Mike Frysinger
2011-11-22 21:11 ` Mike Frysinger
2011-11-23  9:07 ` Stefano Babic
2011-11-23  9:51   ` Robert Deliën
2011-11-23 22:11     ` Mike Frysinger [this message]

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=201111231711.02187.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox