From: felipe.contreras@gmail.com (Felipe Contreras)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] omap: dsp: fix ioremap() usage
Date: Mon, 11 Oct 2010 22:05:38 +0300 [thread overview]
Message-ID: <AANLkTinMhMJhTYoG7TRPUtb8DkTc8hCyH+GWEfKFD80d@mail.gmail.com> (raw)
In-Reply-To: <496565EC904933469F292DDA3F1663E602F47B2BCD@dlee06.ent.ti.com>
On Mon, Oct 11, 2010 at 6:15 PM, Guzman Lugo, Fernando
<fernando.lugo@ti.com> wrote:
>> +#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
>> +
>> +static phys_addr_t omap_dsp_mempool_base;
>> +
>> +static void __init omap_dsp_reserve_mem(struct meminfo *mi) {
>> + ? ? phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
>> + ? ? phys_addr_t addr = ~0;
>> + ? ? int i;
>> +
>> + ? ? if (!size)
>> + ? ? ? ? ? ? return;
>> +
>> + ? ? for (i = mi->nr_banks - 1; i >= 0; i--)
>> + ? ? ? ? ? ? if (mi->bank[i].size >= size) {
>> + ? ? ? ? ? ? ? ? ? ? mi->bank[i].size -= size;
>> + ? ? ? ? ? ? ? ? ? ? addr = mi->bank[i].start + mi->bank[i].size;
>> + ? ? ? ? ? ? ? ? ? ? break;
>> + ? ? ? ? ? ? }
>
> Missing {} in "for" lopp. Even tough you are checking for success inside
> For loop why check again outside? And also not need to define addr.
> What do you think about this:
It comes directly from Russell's code:
http://article.gmane.org/gmane.linux.kernel/1046606
But I do prefer to add the braces. Your proposed patch is ok, although
I prefer to have the important code at the end of the function, and
the error check before that.
Anyway, Russell has come with a different approach, so I have to try
that instead.
Cheers.
--
Felipe Contreras
next prev parent reply other threads:[~2010-10-11 19:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-10 17:40 [PATCH 0/3] staging: tidspbridge: fix ioremap() usage Felipe Contreras
2010-10-10 17:40 ` [PATCH 1/3] arm: mm: allow boards to fiddle with meminfo Felipe Contreras
2010-10-10 19:03 ` Russell King - ARM Linux
2010-10-10 19:37 ` Felipe Contreras
2010-10-10 17:40 ` [PATCH 2/3] omap: dsp: fix ioremap() usage Felipe Contreras
2010-10-10 20:17 ` Premi, Sanjeev
2010-10-10 20:39 ` Felipe Contreras
2010-10-11 15:15 ` Guzman Lugo, Fernando
2010-10-11 19:05 ` Felipe Contreras [this message]
2010-10-10 17:40 ` [PATCH 3/3] staging: tidspbridge: remove memory consistency from TODO list Felipe Contreras
2010-10-11 10:40 ` Arnd Bergmann
2010-10-11 11:16 ` Felipe Contreras
2010-10-11 14:02 ` Arnd Bergmann
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=AANLkTinMhMJhTYoG7TRPUtb8DkTc8hCyH+GWEfKFD80d@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).