Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932864AbZLNVET (ORCPT ); Mon, 14 Dec 2009 16:04:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932876AbZLNVEO (ORCPT ); Mon, 14 Dec 2009 16:04:14 -0500 Received: from exprod6og107.obsmtp.com ([64.18.1.208]:37324 "EHLO exprod6og107.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932974AbZLNVEI convert rfc822-to-8bit (ORCPT ); Mon, 14 Dec 2009 16:04:08 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: [PATCH] au1550nd.c: use kzalloc() Date: Mon, 14 Dec 2009 16:04:07 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] au1550nd.c: use kzalloc() Thread-Index: Acp9APm0qnC54CtWQiGN6hAIxQxxVg== From: "H Hartley Sweeten" To: "kernel list" , Cc: "David Woodhouse" X-OriginalArrivalTime: 14 Dec 2009 21:04:06.0195 (UTC) FILETIME=[F8D96830:01CA7D00] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1383 Lines: 36 Use kzalloc() instead of kmalloc()/memset(). Signed-off-by: H Hartley Sweeten Cc: David Woodhouse --- diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c index 92c334f..de190b8 100644 --- a/drivers/mtd/nand/au1550nd.c +++ b/drivers/mtd/nand/au1550nd.c @@ -450,7 +450,7 @@ static int __init au1xxx_nand_init(void) u32 nand_phys; /* Allocate memory for MTD device structure and private data */ - au1550_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); + au1550_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); if (!au1550_mtd) { printk("Unable to allocate NAND MTD dev structure.\n"); return -ENOMEM; @@ -459,10 +459,6 @@ static int __init au1xxx_nand_init(void) /* Get pointer to private data */ this = (struct nand_chip *)(&au1550_mtd[1]); - /* Initialize structures */ - memset(au1550_mtd, 0, sizeof(struct mtd_info)); - memset(this, 0, sizeof(struct nand_chip)); - /* Link the private data with the MTD structure */ au1550_mtd->priv = this; au1550_mtd->owner = THIS_MODULE; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/