From: Dmitry Torokhov <dtor@insightbb.com>
To: Om Narasimhan <om.turyx@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@lists.osdl.org
Subject: Re: [KJ] kmalloc to kzalloc patches for drivers/base
Date: Mon, 18 Sep 2006 01:08:36 +0000 [thread overview]
Message-ID: <200609172108.37707.dtor@insightbb.com> (raw)
In-Reply-To: <6b4e42d10609171753m2a047081qc2982bf4a693a044@mail.gmail.com>
On Sunday 17 September 2006 20:53, Om Narasimhan wrote:
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 2b8755d..e08950b 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -192,7 +192,7 @@ int platform_device_add_resources(struct
> {
> struct resource *r;
>
> - r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);
> + r = kzalloc(sizeof(struct resource) * num, GFP_KERNEL);
> if (r) {
> memcpy(r, res, sizeof(struct resource) * num);
> pdev->resource = r;
Just out of curiosity could you tell me what is the benefit of
zeroing allocated memory here?
> @@ -216,7 +216,7 @@ int platform_device_add_data(struct plat
> {
> void *d;
>
> - d = kmalloc(size, GFP_KERNEL);
> + d = kzalloc(size, GFP_KERNEL);
> if (d) {
> memcpy(d, data, size);
> pdev->dev.platform_data = d;
>
And here?
--
Dmitry
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dtor@insightbb.com>
To: Om Narasimhan <om.turyx@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@lists.osdl.org
Subject: Re: kmalloc to kzalloc patches for drivers/base
Date: Sun, 17 Sep 2006 21:08:36 -0400 [thread overview]
Message-ID: <200609172108.37707.dtor@insightbb.com> (raw)
In-Reply-To: <6b4e42d10609171753m2a047081qc2982bf4a693a044@mail.gmail.com>
On Sunday 17 September 2006 20:53, Om Narasimhan wrote:
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 2b8755d..e08950b 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -192,7 +192,7 @@ int platform_device_add_resources(struct
> {
> struct resource *r;
>
> - r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);
> + r = kzalloc(sizeof(struct resource) * num, GFP_KERNEL);
> if (r) {
> memcpy(r, res, sizeof(struct resource) * num);
> pdev->resource = r;
Just out of curiosity could you tell me what is the benefit of
zeroing allocated memory here?
> @@ -216,7 +216,7 @@ int platform_device_add_data(struct plat
> {
> void *d;
>
> - d = kmalloc(size, GFP_KERNEL);
> + d = kzalloc(size, GFP_KERNEL);
> if (d) {
> memcpy(d, data, size);
> pdev->dev.platform_data = d;
>
And here?
--
Dmitry
next prev parent reply other threads:[~2006-09-18 1:08 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-18 0:53 [KJ] kmalloc to kzalloc patches for drivers/mfd Om Narasimhan
2006-09-18 0:53 ` Om Narasimhan
2006-09-18 0:53 ` [KJ] kmalloc to kzalloc patches for drivers/atm Om Narasimhan
2006-09-18 0:53 ` Om Narasimhan
2006-09-18 1:19 ` [KJ] " Dmitry Torokhov
2006-09-18 1:19 ` Dmitry Torokhov
2006-09-18 9:42 ` [KJ] " Alan Cox
2006-09-18 9:42 ` Alan Cox
2006-09-18 12:07 ` [KJ] " Pekka Enberg
2006-09-18 12:07 ` Pekka Enberg
2006-09-18 0:53 ` [KJ] kmalloc to kzalloc patches for drivers/base Om Narasimhan
2006-09-18 0:53 ` Om Narasimhan
2006-09-18 1:08 ` Dmitry Torokhov [this message]
2006-09-18 1:08 ` Dmitry Torokhov
2006-09-18 2:27 ` [KJ] " Om Narasimhan
2006-09-18 2:27 ` Om Narasimhan
2006-09-18 9:40 ` [KJ] " Alan Cox
2006-09-18 9:40 ` Alan Cox
2006-09-18 12:31 ` [KJ] " Greg KH
2006-09-18 12:31 ` Greg KH
2006-09-18 0:54 ` [KJ] kmalloc to kzalloc patches for drivers/block Om Narasimhan
2006-09-18 0:54 ` Om Narasimhan
2006-09-18 9:43 ` [KJ] kmalloc to kzalloc patches for drivers/mfd Alan Cox
2006-09-18 9:43 ` Alan Cox
2006-09-21 6:11 ` [KJ] kmalloc to kzalloc patches for drivers/block [sane version] Om Narasimhan
2006-09-21 6:11 ` Om Narasimhan
2006-09-21 7:20 ` [KJ] " Nishanth Aravamudan
2006-09-21 7:20 ` Nishanth Aravamudan
2006-09-22 5:40 ` Om Narasimhan
2006-09-22 5:40 ` Om Narasimhan
2006-09-22 6:04 ` Om Narasimhan
2006-09-22 6:04 ` Om Narasimhan
2006-09-22 8:43 ` Jiri Slaby
2006-09-22 8:43 ` Jiri Slaby
2006-09-22 11:32 ` Paulo Marques
2006-09-22 11:32 ` Paulo Marques
2006-09-22 12:03 ` Pekka Enberg
2006-09-22 12:03 ` Pekka Enberg
2006-09-22 13:03 ` Paulo Marques
2006-09-22 13:03 ` Paulo Marques
2006-09-22 13:45 ` Dmitry Torokhov
2006-09-22 13:45 ` Dmitry Torokhov
2006-09-22 22:55 ` Om Narasimhan
2006-09-22 22:55 ` Om Narasimhan
2006-09-22 8:36 ` Jiri Slaby
2006-09-22 8:36 ` Jiri Slaby
2006-09-22 11:28 ` Paulo Marques
2006-09-22 11:28 ` Paulo Marques
2006-09-21 7:12 ` [KJ] kmalloc to kzalloc patches for drivers/atm " Om Narasimhan
2006-09-21 7:12 ` Om Narasimhan
2006-09-21 13:36 ` [KJ] " Dmitry Torokhov
2006-09-21 13:36 ` Dmitry Torokhov
2006-09-22 5:29 ` [KJ] " Om Narasimhan
2006-09-22 5:29 ` Om Narasimhan
2006-09-21 7:35 ` [KJ] kmalloc to kzalloc patches for drivers/block " Thomas Petazzoni
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=200609172108.37707.dtor@insightbb.com \
--to=dtor@insightbb.com \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=om.turyx@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.