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: Linus Walleij <linus.walleij@stericsson.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Grant Likely <grant.likely@secretlab.ca>,
	Lee Jones <lee.jones@linaro.org>,
	Martin Persson <martin.persson@stericsson.com>,
	Stephen Warren <swarren@nvidia.com>,
	Russell King <linux@arm.linux.org.uk>,
	Linaro Dev <linaro-dev@lists.linaro.org>
Subject: Re: [PATCH 1/2] drivers: create a pinmux subsystem v3
Date: Tue, 14 Jun 2011 11:19:14 +0200	[thread overview]
Message-ID: <BANLkTi=YQcQ2C=RhMrB_CpWXN7ba9SxfEg@mail.gmail.com> (raw)
In-Reply-To: <1307988690.26699.9.camel@Joe-Laptop>

Hi Joe,

thanks for the review, excellent as always.

I fixed all except the below pattern, also searched the source to make sure
there were no other cases of the same errors.

On Mon, Jun 13, 2011 at 8:11 PM, Joe Perches <joe@perches.com> wrote:

>> +int pinctrl_register_pins_dense(struct pinctrl_pin_desc const *pins,
>> +                              unsigned num_descs, unsigned num_pins)
>> +{
>> +     int ret;
>> +     unsigned i;
>> +
>> +     ret = pinctrl_register_pins(pins, num_descs, num_pins);
>> +     if (ret) {
>> +             for (i = 0; i < num_pins; i++) {
>> +                     struct pin_desc *pindesc;
>> +
>> +                     spin_lock(&pin_desc_tree_lock);
>> +                     pindesc = radix_tree_lookup(&pin_desc_tree, i);
>> +                     if (pindesc != NULL) {
>> +                             radix_tree_delete(&pin_desc_tree, i);
>> +                             num_pins --;
>> +                     }
>> +                     spin_unlock(&pin_desc_tree_lock);
>> +                     kfree(pindesc);
>> +             }
>
> Second use of this pattern.  Maybe use pinctrl_free_pindescs?

It is quite different actually - in the second case here. we loop over a list
with holes, and we pick each one pin. We cannot loop over the entire
pin range because in this case we don't know the size of the range.

Thanks,
Linus Walleij

  reply	other threads:[~2011-06-14  9:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13 16:58 [PATCH 1/2] drivers: create a pinmux subsystem v3 Linus Walleij
2011-06-13 18:11 ` Joe Perches
2011-06-14  9:19   ` Linus Walleij [this message]
2011-06-13 19:57 ` Grant Likely
2011-06-14 11:33   ` Linus Walleij
2011-07-09 10:23   ` Mark Brown
2011-08-19 11:59     ` Linus Walleij
2011-06-13 23:28 ` Stephen Warren
2011-06-14 14:25   ` Linus Walleij
2011-06-14 22:11     ` Stephen Warren
2011-06-16 12:47       ` Linus Walleij
2011-06-16 19:10         ` Stephen Warren
2011-06-27 14:34           ` Linus Walleij
2011-06-29 21:23             ` Stephen Warren
2011-08-19 12:34         ` Linus Walleij
2011-07-14  5:57 ` Barry Song
2011-08-08  2:28   ` Barry Song
2011-08-19 11:53   ` Linus Walleij

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=YQcQ2C=RhMrB_CpWXN7ba9SxfEg@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=joe@perches.com \
    --cc=lee.jones@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=martin.persson@stericsson.com \
    --cc=swarren@nvidia.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).