From: Stephen Warren <swarren@wwwdotorg.org>
To: "devendra.aaru" <devendra.aaru@gmail.com>
Cc: linux-kernel@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
Subject: Re: Q: pinctrl: freeing out the allocated map in tegra_pinctrl_dt_node_to_map
Date: Fri, 10 Aug 2012 09:17:48 -0600 [thread overview]
Message-ID: <5025261C.4070509@wwwdotorg.org> (raw)
In-Reply-To: <CAHdPZaOHNW3gBHFdfkg==mQVOTdoCKiURqt=J+bWPJn=_no4LQ@mail.gmail.com>
On 08/09/2012 11:35 PM, devendra.aaru wrote:
> On Fri, Aug 10, 2012 at 11:02 AM, devendra.aaru <devendra.aaru@gmail.com> wrote:
>> Hi,
>>
>> In function tegra_pinctrl_dt_node_to_map the num_maps the num_maps
>> counter must be incremented for each child node?
This I commented on below.
>> 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.
I don't quite understand this part, sorry.
>> Thanks,
>> @@ -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);
That's wrong; tegra_pinctrl_dt_subnode_to_map() calls add_map_mux()
and/or add_map_configs() which increments *num_maps.
Besides, num_maps is a pointer to an integer, so if this was right, it
should be (*num_maps)++.
prev parent reply other threads:[~2012-08-10 15:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 5:35 Q: pinctrl: freeing out the allocated map in tegra_pinctrl_dt_node_to_map devendra.aaru
2012-08-10 15:17 ` Stephen Warren [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=5025261C.4070509@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox