All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "devendra.aaru" <devendra.aaru@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Subject: 
Date: Fri, 10 Aug 2012 11:02:43 +0530	[thread overview]
Message-ID: <CAHdPZaM=Pytu3a1cm+FK=bGARZ8iZz3vaVZmtiBU6SFc5VfL3Q@mail.gmail.com> (raw)

Hi,

In function tegra_pinctrl_dt_node_to_map the num_maps the num_maps
counter must be incremented for each child node?


Actually we are doing free until num_maps if tegra_pinctrl_dt_subnode_to_map,

not only that if num_maps == 0, we wont free up the maps, and also i
think the for_each_of_node checks whether we have a next child node,
so its safe to do num_maps++ as it wont get incremented endlessly,

Please correct me if i am wrong.

Thanks,


diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
index ae52e4e..33ae918 100644
--- a/drivers/pinctrl/pinctrl-tegra.c
+++ b/drivers/pinctrl/pinctrl-tegra.c
@@ -303,6 +303,7 @@ int tegra_pinctrl_dt_node_to_map(struct
pinctrl_dev *pctldev,
        *num_maps = 0;

        for_each_child_of_node(np_config, np) {
+               num_maps++;
                ret = tegra_pinctrl_dt_subnode_to_map(pctldev->dev, np, map,
                                                      &reserved_maps, num_maps);
                if (ret < 0) {

             reply	other threads:[~2012-08-10  5:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10  5:32 devendra.aaru [this message]
2012-08-10  8:45 ` Linus Walleij
2012-08-10 10:47 ` Re: Bernd Petrovitsch

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='CAHdPZaM=Pytu3a1cm+FK=bGARZ8iZz3vaVZmtiBU6SFc5VfL3Q@mail.gmail.com' \
    --to=devendra.aaru@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.