Skip to contentSkip to conversation

dm: dm-target.c Convert kmalloc + memset to kzalloc

PATCH Robert P. J. Day 2 participants 2 messages Jul 24, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

-----Original Message-----

Quoted 34 lines

From: Dmitry Monakhov <[email protected]>
Sent: Jul 24, 2007 4:59 AM
To: [email protected]
Cc: device-mapper development <[email protected]>
Subject: [PATCH 8/8] dm: dm-target.c Convert kmalloc + memset to kzalloc

---
drivers/md/dm-target.c | 6 ++----

1 files changed, 2 insertions(+), 4 deletions(-)
drivers/md/dm-target.c +2 -4
index 477a041..835cf95 100644
@@ -88,12 +88,10 @@ void dm_put_target_type(struct target_type *t)
 
 static struct tt_internal *alloc_target(struct target_type *t)
 {
-	struct tt_internal *ti = kmalloc(sizeof(*ti), GFP_KERNEL);
+	struct tt_internal *ti = kzalloc(sizeof(*ti), GFP_KERNEL);
 
-	if (ti) {
-		memset(ti, 0, sizeof(*ti));
+	if (ti)
 		ti->tt = *t;
-	}
 
 	return ti;
 }
Signature · 1 line
1.5.2.2

would it not have made more sense to have submitted all those related, single-change patches as one patch?

rday

#1 lore raw
Quoted 31 lines · Robert P. J. Day

-----Original Message-----

Quoted 28 lines

From: Dmitry Monakhov <[email protected]>
Sent: Jul 24, 2007 4:59 AM
To: [email protected]
Cc: device-mapper development <[email protected]>
Subject: [PATCH 8/8] dm: dm-target.c Convert kmalloc + memset to kzalloc

---
drivers/md/dm-target.c | 6 ++----

1 files changed, 2 insertions(+), 4 deletions(-)
drivers/md/dm-target.c +2 -4
index 477a041..835cf95 100644
@@ -88,12 +88,10 @@ void dm_put_target_type(struct target_type *t)
 
 static struct tt_internal *alloc_target(struct target_type *t)
 {
-	struct tt_internal *ti = kmalloc(sizeof(*ti), GFP_KERNEL);
+	struct tt_internal *ti = kzalloc(sizeof(*ti), GFP_KERNEL);
 
-	if (ti) {
-		memset(ti, 0, sizeof(*ti));
+	if (ti)
 		ti->tt = *t;
-	}
 
Quoted 9 lines
Quoted 6 lines
drivers/md/dm-target.c +0 -0
 	return ti;
 }
Signature · 1 line
1.5.2.2

would it not have made more sense to have submitted all those related, single-change patches as one patch?

Yes i think so (i've already wrote bout this in fist msg), but dm maintainers may have different oppinion.
BTW: It is allways easier fold many patches to one, than split one patch to many.

Quoted 10 lines

rday

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/