linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Joe Perches <joe@perches.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Martin Persson <martin.persson@stericsson.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/4] drivers: create a pinmux subsystem
Date: Wed, 11 May 2011 00:52:20 +0200	[thread overview]
Message-ID: <BANLkTi=zDJLHUa2ogTeEkmdsbkhvGJCsEw@mail.gmail.com> (raw)
In-Reply-To: <1305067020.19586.130.camel@Joe-Laptop>

2011/5/11 Joe Perches <joe@perches.com>:
> On Wed, 2011-05-11 at 00:18 +0200, Linus Walleij wrote:
>> 2011/5/2 Joe Perches <joe@perches.com>:
>> > On Mon, 2011-05-02 at 21:16 +0200, Linus Walleij wrote:
>> >> From: Linus Walleij <linus.walleij@linaro.org>
>> >> diff --git a/drivers/pinmux/core.c b/drivers/pinmux/core.c
>> > Trivial comments follow
>> >> +static inline int pin_is_valid(int pin)
>> >> +{
>> >> +     return ((unsigned)pin) < MACH_NR_PINS;
>> >> +}
>> > Couldn't pin just be declared unsigned or maybe u32?
>> No, because like in the GPIO subsystem you *may* want to send in invalid
>> pins, and those are identified by negative numbers.
>
> Then I think this is clearer and the compiler
> should produce the same code.
>
> static inline bool pin_is_valid(int pin)
> {
>        return pin >= 0 && pin < MACH_NR_PINS;
> }

Yes indeed, I'll fix. Can you propose a patch to the same pattern
found in include/asm-generic/gpio.h? It would bring equal
clarity there I believe.

Thanks!
Linus Walleij

  reply	other threads:[~2011-05-10 22:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 19:16 [PATCH 1/4] drivers: create a pinmux subsystem Linus Walleij
2011-05-02 19:37 ` Joe Perches
2011-05-10 22:18   ` Linus Walleij
2011-05-10 22:37     ` Joe Perches
2011-05-10 22:52       ` Linus Walleij [this message]
2011-05-10 23:23         ` [PATCH] gpio: Convert gpio_is_valid to return bool Joe Perches
2011-05-10 23:42           ` Linus Walleij
2011-05-27  3:02           ` Grant Likely
2011-05-10 22:40     ` [PATCH 1/4] drivers: create a pinmux subsystem Mark Brown
2011-05-02 20:52 ` Stephen Warren
2011-05-02 21:30   ` Colin Cross
2011-05-04  9:22     ` Tony Lindgren
2011-05-07 19:06       ` Mike Rapoport
2011-05-09 15:25         ` Tony Lindgren
2011-05-03  1:45   ` Ben Nizette
2011-05-10 22:46   ` Linus Walleij
2011-05-03  1:47 ` Ben Nizette
2011-05-04  9:16 ` Tony Lindgren
2011-05-07 19:10   ` Mike Rapoport
2011-05-09 15:46     ` Tony Lindgren
2011-05-05 18:16 ` Rohit Vaswani
2011-05-07 20:09 ` Greg KH

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='BANLkTi=zDJLHUa2ogTeEkmdsbkhvGJCsEw@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=joe@perches.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.persson@stericsson.com \
    /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;
as well as URLs for NNTP newsgroup(s).