Re: [PATCHv4 4/4] DSPBRIDGE: Improved mapped memory cleanup

Ameya Palande
2010-02-18T14:48:33Z

Hi Felipe,

On Thu, 2010-02-18 at 15:27 +0100, Contreras Felipe (Nokia-D/Helsinki)
wrote:
> On Thu, Feb 18, 2010 at 01:15:55PM +0100, Ameya Palande wrote:
> > On Thu, 2010-02-18 at 02:52 +0100, ext Guzman Lugo, Fernando wrote:
> > > What do you think about it?
> > > Instead of removing DRV_InsertDMMResElement make it an inline function with your code inside:
> >
> > Making DRV_InsertDMMResElement inline doesn't make sense since we are
> > not calling it multiple times.
>
> I agree with Fernando; the code would be more readable. Even more if we
> rename the function to instert_map_element().

I guess the issue is about why this code is doing it rather than the
readability of code. I have sent V5 of the patchset with comment
explaining the purpose of doing this.

If you think that by creating a new static inline function like
insert_map_element(), we can understand it better then following comment
also does the same thing:

/* Following code inserts a map element ... and explain why */

Anyways insert_map_element() function doesn't explain why it is
required :(

Cheers,
Ameya.