public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Santosh <santosh.shilimkar@ti.com>
To: Sricharan R <r.sricharan@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>, linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/8] OMAP: hwmod: Fix the addr spaces count API.
Date: Thu, 08 Sep 2011 15:02:42 +0530	[thread overview]
Message-ID: <4E688BBA.3010803@ti.com> (raw)
In-Reply-To: <5e4ae8f3e715eb5e46468695a88c541a@mail.gmail.com>

On Thursday 08 September 2011 02:45 PM, Sricharan R wrote:
> Hi Benoit,
>
>> -----Original Message-----
>> From: Sricharan R [mailto:r.sricharan@ti.com]
>> Sent: Thursday, September 08, 2011 2:35 PM
>> To: Sricharan R
>> Subject: Re: [PATCH 1/8] OMAP: hwmod: Fix the addr spaces count API.
>>

[...]

>>>
>>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c
>> b/arch/arm/mach-omap2/omap_hwmod.c
>>> index 84cc0bd..32a0f48a 100644
>>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>>> @@ -791,9 +791,11 @@ static int _count_ocp_if_addr_spaces(struct
>> omap_hwmod_ocp_if *os)
>>>    	if (!os || !os->addr)
>>>    		return 0;
>>>
>>> -	do {
>>> -		mem =&os->addr[i++];
>>> -	} while (mem->pa_start != mem->pa_end);
>>> +	mem =&os->addr[i];
>>> +
This extran line isn't needed Sricharan.

>>> +	while (mem->pa_start != mem->pa_end) {
>>> +		mem =&os->addr[++i];
>>> +	};
>>>
>>>    	return i;
>>
>> Cannot you just do "return i - 1"?
>
> Right. That was the first idea.
> But after some discussion concluded that
> right way is to, not to take in to account, the
> null structure itself, rather than incrementing and
> decrementing.
>
I was the one who objected to the i-1 or i--
change. The count logic itself should
handle all the scenario's.

Regards
Santosh



  reply	other threads:[~2011-09-08  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f44b67c9efd46d2e7d078da4d3acd30c@mail.gmail.com>
2011-09-08  9:15 ` [PATCH 1/8] OMAP: hwmod: Fix the addr spaces count API Sricharan R
2011-09-08  9:32   ` Santosh [this message]
2011-09-08 13:03     ` Sricharan R
2011-09-08 15:06     ` Cousson, Benoit
2011-09-08  5:21 [PATCH 0/8] OMAP3/4: Misc fixes and clean-up Santosh Shilimkar
2011-09-08  5:22 ` [PATCH 1/8] OMAP: hwmod: Fix the addr spaces count API Santosh Shilimkar
2011-09-08  7:47   ` Cousson, Benoit

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=4E688BBA.3010803@ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=b-cousson@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=r.sricharan@ti.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