From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Surya Prabhakar N <surya.prabhakar@wipro.com>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [KJ-resend]replacing kmalloc with kzalloc in drivers/mtd/chips/cfi_probe.c
Date: Mon, 13 Aug 2007 05:47:01 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0708130545510.19318@localhost.localdomain> (raw)
In-Reply-To: <1186998573.29518.6.camel@bluegenie>
On Mon, 13 Aug 2007, Surya Prabhakar N wrote:
>
> Hi,
> Replacing kmalloc with kzalloc and cleaning up memset in
> drivers/mtd/chips/cfi_probe.c. Kindly ignore the previous similar patch.
>
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
> ---
>
> diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
> index 60e11a0..efb51f7 100644
> --- a/drivers/mtd/chips/cfi_probe.c
> +++ b/drivers/mtd/chips/cfi_probe.c
> @@ -203,14 +203,12 @@ static int __xipram cfi_chip_setup(struct map_info *map,
> if (!num_erase_regions)
> return 0;
>
> - cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
> + cfi->cfiq = kzalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
> if (!cfi->cfiq) {
> printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
> return 0;
> }
>
> - memset(cfi->cfiq,0,sizeof(struct cfi_ident));
> -
> cfi->cfi_mode = CFI_MODE_CFI;
but that change is not precisely equivalent, it now clears more than
the original code. as long as that's not a problem.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
prev parent reply other threads:[~2007-08-13 14:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 9:49 Surya Prabhakar N
2007-08-13 9:47 ` Robert P. J. Day [this message]
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=Pine.LNX.4.64.0708130545510.19318@localhost.localdomain \
--to=rpjday@mindspring.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=surya.prabhakar@wipro.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
all inboxes | Powered by JetHome®