Skip to contentSkip to conversation

Remove unnecessary memset from physmap_of driver

PATCH In review Valentine Barshak 3 participants 4 messages Oct 2, 2007 – Oct 3, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove unnecessary memset from physmap_of driver

No need for memset to zero memory here, since we use kzalloc.

---
 drivers/mtd/maps/physmap_of.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/mtd/maps/physmap_of.c +0 -1
index cf75a56..aeed9ea 100644
@@ -232,7 +232,6 @@ static int __devinit of_flash_probe(struct of_device *dev,
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		goto err_out;
-	memset(info, 0, sizeof(*info));
 
 	dev_set_drvdata(&dev->dev, info);
 
Signature · 1 line
1.5.2.4
#2 lore raw
Quoted 11 lines · Paul Mackerras
Quoted 5 lines · Valentine Barshak

No need for memset to zero memory here, since we use kzalloc.

---
 drivers/mtd/maps/physmap_of.c |    1 -

Please cc the mtd list ([email protected]) and/or David Woodhouse on MTD patches. Posting them to linuxppc-dev isn't going to get them upstream.

Except when I screw up and pull them into my tree. Which won't happen again.

josh

#3 lore raw

PATCH 1/1 mtd: remove unnecessary memset from physmap_of driver

In reply to Paul Mackerras

No need for memset to zero memory here, since we use kzalloc.

---
 drivers/mtd/maps/physmap_of.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/mtd/maps/physmap_of.c +0 -1
index cf75a56..aeed9ea 100644
@@ -232,7 +232,6 @@ static int __devinit of_flash_probe(struct of_device *dev,
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		goto err_out;
-	memset(info, 0, sizeof(*info));
 
 	dev_set_drvdata(&dev->dev, info);
 
Signature · 1 line
1.5.2.4