From: Imre Deak <imre.deak@nokia.com>
To: ext Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Shevchenko Andriy (EXT-Teleca/Helsinki)"
<ext-andriy.shevchenko@nokia.com>
Subject: Re: [PATCH] dspbridge: use linux memory allocator directly
Date: Wed, 2 Sep 2009 20:49:41 +0300 [thread overview]
Message-ID: <20090902174941.GA25799@localhost> (raw)
In-Reply-To: <1251912430-23182-1-git-send-email-andy.shevchenko@gmail.com>
On Wed, Sep 02, 2009 at 07:27:10PM +0200, ext Andy Shevchenko wrote:
> From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
>
> Instead of MEM_Calloc()/MEM_Free() use kzalloc()/kfree() calls. Thus we get rid
> of mem.h dependency.
>
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> ---
> arch/arm/plat-omap/include/dspbridge/list.h | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/plat-omap/include/dspbridge/list.h b/arch/arm/plat-omap/include/dspbridge/list.h
> index c9d9e49..cda1d21 100644
> --- a/arch/arm/plat-omap/include/dspbridge/list.h
> +++ b/arch/arm/plat-omap/include/dspbridge/list.h
> @@ -49,8 +49,8 @@
> #define LIST_
>
> #include <dspbridge/host_os.h>
> -/* MEM_Calloc(), MEM_NONPAGED, MEM_Free() */
> -#include <dspbridge/mem.h>
> +#include <linux/types.h>
> +#include <linux/slab.h>
> #include <linux/list.h>
>
> #define LST_ELEM list_head
> @@ -85,9 +85,9 @@ struct LST_LIST {
> static inline struct LST_LIST *LST_Create(void)
> {
> struct LST_LIST *pList;
> + gfp_t flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
>
> - pList = (struct LST_LIST *) MEM_Calloc(sizeof(struct LST_LIST),
> - MEM_NONPAGED);
> + pList = (struct LST_LIST *) kzalloc(sizeof(struct LST_LIST), flags);
> if (pList != NULL)
> INIT_LIST_HEAD(&pList->head);
>
> @@ -116,7 +116,8 @@ static inline struct LST_LIST *LST_Create(void)
> */
> static inline void LST_Delete(struct LST_LIST *pList)
> {
> - MEM_Free(pList);
> + if (pList != NULL)
> + kfree(pList);
No need to check, since kfree does it for you.
--Imre
next prev parent reply other threads:[~2009-09-02 17:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 11:39 dspbridge: draft: get rid of services/list.c Andy Shevchenko
2009-09-01 11:39 ` [PATCH 1/2] DSPBRIDGE: Get rid of services/list.c (step 1) Andy Shevchenko
2009-09-01 11:39 ` [PATCH 2/2] DSPBRIDGE: Get rid of services/list.c (step 2) Andy Shevchenko
2009-09-02 17:27 ` [PATCH] dspbridge: use linux memory allocator directly Andy Shevchenko
2009-09-02 17:49 ` Imre Deak [this message]
2009-09-03 6:48 ` Andy Shevchenko
2009-09-03 6:57 ` Felipe Balbi
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=20090902174941.GA25799@localhost \
--to=imre.deak@nokia.com \
--cc=andy.shevchenko@gmail.com \
--cc=ext-andriy.shevchenko@nokia.com \
--cc=linux-omap@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