public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: <vignesh.babu@wipro.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ][PATCH]mmtimer.c-kzalloc
Date: Mon, 16 Apr 2007 05:56:48 +0000	[thread overview]
Message-ID: <1176702729.9356.11.camel@wriver-t81fb058.linuxcoe> (raw)

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]


Replacing kmalloc/memset combination with kzalloc.

Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
---
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c
index c091603..6e55cfb 100644
--- a/drivers/char/mmtimer.c
+++ b/drivers/char/mmtimer.c
@@ -705,15 +705,13 @@ static int __init mmtimer_init(void)
 	maxn++;
 
 	/* Allocate list of node ptrs to mmtimer_t's */
-	timers = kmalloc(sizeof(mmtimer_t *)*maxn, GFP_KERNEL);
+	timers = kzalloc(sizeof(mmtimer_t *)*maxn, GFP_KERNEL);
 	if (timers == NULL) {
 		printk(KERN_ERR "%s: failed to allocate memory for device\n",
 				MMTIMER_NAME);
 		goto out3;
 	}
 
-	memset(timers,0,(sizeof(mmtimer_t *)*maxn));
-
 	/* Allocate mmtimer_t's for each online node */
 	for_each_online_node(node) {
 		timers[node] = kmalloc_node(sizeof(mmtimer_t)*NUM_COMPARATORS, GFP_KERNEL, node);

-- 
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3173 bytes --]

             reply	other threads:[~2007-04-16  5:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-16  5:56 vignesh.babu [this message]
2007-04-18  0:07 ` [KJ][PATCH]mmtimer.c-kzalloc Christoph Lameter

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=1176702729.9356.11.camel@wriver-t81fb058.linuxcoe \
    --to=vignesh.babu@wipro.com \
    --cc=kernel-janitors@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