All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] unsigned int for gpio
Date: Wed, 11 Jun 2014 23:37:25 +0200	[thread overview]
Message-ID: <1402522645.4361.18.camel@yellow> (raw)

Hello Simon,

in commit 95a260a9


dm: Enable gpio command to support driver model
    
Now that named GPIO banks are supported, along with a way of obtaining
the status of a GPIO (input or output), we can provide an enhanced
GPIO command for driver model. Where the driver provides its own
operation for obtaining the GPIO state, this is used, otherwise a
generic version is sufficient.

you made the following change:

-       int gpio;
+       unsigned int gpio;

This breaks the code after it though:

        /* turn the gpio name into a gpio number */
        gpio = name_to_gpio(str_gpio);
        if (gpio < 0)
                goto show_usage;

And causes warnings with clang like:

common/cmd_gpio.c:159:11: warning: comparison of unsigned expression < 0
is always false [-Wtautological-compare]
        if (gpio < 0)
            ~~~~ ^ ~

Do you recall why it is made unsigned?

Regards,
Jeroen

             reply	other threads:[~2014-06-11 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 21:37 Jeroen Hofstee [this message]
2014-06-11 23:12 ` [U-Boot] unsigned int for gpio Simon Glass
2014-06-12 21:03   ` Jeroen Hofstee

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=1402522645.4361.18.camel@yellow \
    --to=jeroen@myspectrum.nl \
    --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 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.