* [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc
@ 2006-07-21 11:32 takis
2006-07-21 12:13 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: takis @ 2006-07-21 11:32 UTC (permalink / raw)
To: linux-kernel; +Cc: axboe
From: Panagiotis Issaris <takis@issaris.org>
block: Conversions from kmalloc+memset to kzalloc
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
---
block/cfq-iosched.c | 4 +---
block/elevator.c | 3 +--
block/scsi_ioctl.c | 4 +---
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 102ebc2..d3d095f 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2231,12 +2231,10 @@ static void *cfq_init_queue(request_queu
struct cfq_data *cfqd;
int i;
- cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL);
+ cfqd = kzalloc(sizeof(*cfqd), GFP_KERNEL);
if (!cfqd)
return NULL;
- memset(cfqd, 0, sizeof(*cfqd));
-
for (i = 0; i < CFQ_PRIO_LISTS; i++)
INIT_LIST_HEAD(&cfqd->rr_list[i]);
diff --git a/block/elevator.c b/block/elevator.c
index bc7baee..e51febf 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -153,9 +153,8 @@ static struct kobj_type elv_ktype;
static elevator_t *elevator_alloc(struct elevator_type *e)
{
- elevator_t *eq = kmalloc(sizeof(elevator_t), GFP_KERNEL);
+ elevator_t *eq = kzalloc(sizeof(elevator_t), GFP_KERNEL);
if (eq) {
- memset(eq, 0, sizeof(*eq));
eq->ops = &e->ops;
eq->elevator_type = e;
kobject_init(&eq->kobj);
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index b33eda2..f6a8bea 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -409,11 +409,9 @@ int sg_scsi_ioctl(struct file *file, str
bytes = max(in_len, out_len);
if (bytes) {
- buffer = kmalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN);
+ buffer = kzalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN);
if (!buffer)
return -ENOMEM;
-
- memset(buffer, 0, bytes);
}
rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);
--
1.4.2.rc1.ge7a0-dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc
2006-07-21 11:32 [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc takis
@ 2006-07-21 12:13 ` Jens Axboe
2006-07-21 12:32 ` Panagiotis Issaris
0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2006-07-21 12:13 UTC (permalink / raw)
To: takis; +Cc: linux-kernel
On Fri, Jul 21 2006, takis@issaris.org wrote:
> From: Panagiotis Issaris <takis@issaris.org>
>
> block: Conversions from kmalloc+memset to kzalloc
They are already done in the block git repo.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc
2006-07-21 12:13 ` Jens Axboe
@ 2006-07-21 12:32 ` Panagiotis Issaris
2006-07-21 12:38 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Panagiotis Issaris @ 2006-07-21 12:32 UTC (permalink / raw)
To: Jens Axboe; +Cc: takis, linux-kernel
Hi,
On vr, 2006-07-21 at 14:13 +0200, Jens Axboe wrote:
> On Fri, Jul 21 2006, takis@issaris.org wrote:
> > From: Panagiotis Issaris <takis@issaris.org>
> >
> > block: Conversions from kmalloc+memset to kzalloc
>
> They are already done in the block git repo.
Weird, I had even checked if they weren't already done:
http://kernel.org/git/?p=linux/kernel/git/axboe/linux-2.6-block.git;a=blob;h=102ebc2c5c34c73f8e7f76c589559ddfde0d9885;hb=82d6897fefca6206bca7153805b4c5359ce97fc4;f=block/cfq-iosched.c
Am I looking at the wrong repos, or is it just not in sync
with your daily work?
With friendly regards,
Takis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc
2006-07-21 12:32 ` Panagiotis Issaris
@ 2006-07-21 12:38 ` Jens Axboe
2006-07-21 12:58 ` Panagiotis Issaris
0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2006-07-21 12:38 UTC (permalink / raw)
To: Panagiotis Issaris; +Cc: takis, linux-kernel
On Fri, Jul 21 2006, Panagiotis Issaris wrote:
> Hi,
>
> On vr, 2006-07-21 at 14:13 +0200, Jens Axboe wrote:
> > On Fri, Jul 21 2006, takis@issaris.org wrote:
> > > From: Panagiotis Issaris <takis@issaris.org>
> > >
> > > block: Conversions from kmalloc+memset to kzalloc
> >
> > They are already done in the block git repo.
> Weird, I had even checked if they weren't already done:
> http://kernel.org/git/?p=linux/kernel/git/axboe/linux-2.6-block.git;a=blob;h=102ebc2c5c34c73f8e7f76c589559ddfde0d9885;hb=82d6897fefca6206bca7153805b4c5359ce97fc4;f=block/cfq-iosched.c
>
> Am I looking at the wrong repos, or is it just not in sync
> with your daily work?
It should be in the iosched branch.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc
2006-07-21 12:38 ` Jens Axboe
@ 2006-07-21 12:58 ` Panagiotis Issaris
0 siblings, 0 replies; 5+ messages in thread
From: Panagiotis Issaris @ 2006-07-21 12:58 UTC (permalink / raw)
To: Jens Axboe; +Cc: takis, linux-kernel
Hi,
On vr, 2006-07-21 at 14:38 +0200, Jens Axboe wrote:
> On Fri, Jul 21 2006, Panagiotis Issaris wrote:
> > Hi,
> >
> > On vr, 2006-07-21 at 14:13 +0200, Jens Axboe wrote:
> > > On Fri, Jul 21 2006, takis@issaris.org wrote:
> > > > From: Panagiotis Issaris <takis@issaris.org>
> > > >
> > > > block: Conversions from kmalloc+memset to kzalloc
> > >
> > > They are already done in the block git repo.
> > Weird, I had even checked if they weren't already done:
> > http://kernel.org/git/?p=linux/kernel/git/axboe/linux-2.6-block.git;a=blob;h=102ebc2c5c34c73f8e7f76c589559ddfde0d9885;hb=82d6897fefca6206bca7153805b4c5359ce97fc4;f=block/cfq-iosched.c
> >
> > Am I looking at the wrong repos, or is it just not in sync
> > with your daily work?
>
> It should be in the iosched branch.
Ah... branches! Forgot about those :) So, I guess that makes it nearly
impossible to avoid effort duplication.
Unless ofcourse, there would be a git script which would check if any of
the maintainers have changed a specific line in any of their branches.
Thanks.
With friendly regards,
Takis
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-21 12:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-21 11:32 [PATCH] block: Conversions from kmalloc+memset to k(z|c)alloc takis
2006-07-21 12:13 ` Jens Axboe
2006-07-21 12:32 ` Panagiotis Issaris
2006-07-21 12:38 ` Jens Axboe
2006-07-21 12:58 ` Panagiotis Issaris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox