mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: gregkh@linuxfoundation.org, sachin.kamat@linaro.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	dulshani.gunawardhana89@gmail.com
Subject: Re: [PATCH] staging: cxt1e1: use kzalloc instead of kmalloc/memset 0
Date: Wed, 5 Mar 2014 11:04:05 +0100	[thread overview]
Message-ID: <20140305100405.GG1883@distanz.ch> (raw)
In-Reply-To: <1673333.LFj7fBDsDS@daeseok-laptop.cloud.net>

On 2014-03-05 at 03:37:15 +0100, Daeseok Youn <daeseok.youn@gmail.com> wrote:
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/cxt1e1/sbecom_inline_linux.h |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/cxt1e1/sbecom_inline_linux.h b/drivers/staging/cxt1e1/sbecom_inline_linux.h
> index ba3ff3e..6dd1b55 100644
> --- a/drivers/staging/cxt1e1/sbecom_inline_linux.h
> +++ b/drivers/staging/cxt1e1/sbecom_inline_linux.h
> @@ -46,11 +46,9 @@ void        pci_write_32 (u_int32_t *p, u_int32_t v);
>  static inline void *
>  OS_kmalloc (size_t size)
>  {
> -    char       *ptr = kmalloc (size, GFP_KERNEL | GFP_DMA);
> +	char *ptr = kzalloc(size, GFP_KERNEL | GFP_DMA);
>  
> -    if (ptr)
> -        memset (ptr, 0, size);
> -    return ptr;
> +	return ptr;
>  }

It would probably be even better to get rid of this function altogether
and replace all calls to it by kmalloc/kzalloc.

>From a quick look at the users of OS_kmalloc, it also looks like GFP_DMA
isn't needed for all of them.

Cheers
Tobias

  reply	other threads:[~2014-03-05 10:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05  2:37 Daeseok Youn
2014-03-05 10:04 ` Tobias Klauser [this message]
2014-03-06  7:02   ` DaeSeok Youn

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=20140305100405.GG1883@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=daeseok.youn@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dulshani.gunawardhana89@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sachin.kamat@linaro.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

all inboxes | Powered by JetHome®