From: Felipe Contreras <felipe.contreras@nokia.com>
To: "Palande Ameya (Nokia-D/Helsinki)" <ameya.palande@nokia.com>
Cc: "ext Guzman Lugo, Fernando" <x0095840@ti.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Menon, Nishanth" <nm@ti.com>,
"Chitriki Rudramuni, Deepak" <deepak.chitriki@ti.com>,
"Ramirez Luna, Omar" <omar.ramirez@ti.com>
Subject: Re: [PATCHv4 4/4] DSPBRIDGE: Improved mapped memory cleanup
Date: Thu, 18 Feb 2010 16:27:28 +0200 [thread overview]
Message-ID: <20100218142728.GD4097@annwn.felipec.org> (raw)
In-Reply-To: <1266495355.2105.5.camel@sanganak>
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().
note: should be 'static inline'
> > inline void DRV_InsertDMMResElement(u32 ppMapAddr)
> > {
> > map_obj = kmalloc(sizeof(struct DMM_MAP_OBJECT), GFP_KERNEL);
> > if (map_obj) {
> > map_obj->dsp_addr = (u32)*ppMapAddr;
> > spin_lock(&pr_ctxt->dmm_map_lock);
> > list_add(&map_obj->link, &pr_ctxt->dmm_map_list);
> > spin_unlock(&pr_ctxt->dmm_map_lock);
> > }
> > }
> >
> > It could make the code more understandable about what it is actually doing.
> > It also applies to the functions which removes this patch.
>
> I can put a comment here to clarify what this code is doing ;)
AFAIK in linux, self-documenting code is preferred over comments.
Cheers.
--
Felipe Contreras
next prev parent reply other threads:[~2010-02-18 14:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-17 18:05 [PATCHv4 0/4] DSPBRIDGE: Improved reserved and mapped resource cleanup Ameya Palande
2010-02-17 18:05 ` [PATCHv4 1/4] DSPBRIDGE: Rename DMM_RES_OBJECT to DMM_MAP_OBJECT Ameya Palande
2010-02-17 18:05 ` [PATCHv4 2/4] DSPBRIDGE: New reserved memory accounting framework Ameya Palande
2010-02-18 1:40 ` Guzman Lugo, Fernando
2010-02-18 14:48 ` Ameya Palande
2010-02-17 18:05 ` [PATCHv4 3/4] DSPBRIDGE: Fix memory corruption in DRV_ProcFreeDMMRes Ameya Palande
2010-02-17 18:05 ` [PATCHv4 4/4] DSPBRIDGE: Improved mapped memory cleanup Ameya Palande
2010-02-18 1:52 ` Guzman Lugo, Fernando
2010-02-18 12:15 ` Ameya Palande
2010-02-18 14:27 ` Felipe Contreras [this message]
2010-02-18 14:47 ` Ameya Palande
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=20100218142728.GD4097@annwn.felipec.org \
--to=felipe.contreras@nokia.com \
--cc=ameya.palande@nokia.com \
--cc=deepak.chitriki@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=omar.ramirez@ti.com \
--cc=x0095840@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