Skip to contentSkip to conversation

mtd/nand/atmel: Delete an error message for a failed memory allocation in two functions

PATCH In review SF Markus Elfring 3 participants 4 messages Jan 5, 2018 – Jan 8, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd/nand/atmel: Delete an error message for a failed memory allocation in two functions

From: Markus Elfring <[email protected]>
Date: Fri, 5 Jan 2018 21:45:04 +0100

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

---
 drivers/mtd/nand/atmel/nand-controller.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mtd/nand/atmel/nand-controller.c +2 -6
index 90a71a56bc23..a41b999229c9 100644
@@ -1612,10 +1612,8 @@ static int atmel_nand_register(struct atmel_nand *nand)
 		mtd->name = devm_kasprintf(nc->dev, GFP_KERNEL,
 					   "%s:nand.%d", dev_name(nc->dev),
 					   nand->cs[0].id);
-		if (!mtd->name) {
-			dev_err(nc->dev, "Failed to allocate mtd->name\n");
+		if (!mtd->name)
 			return -ENOMEM;
-		}
 	}
 
 	ret = nand_scan_tail(mtd);
@@ -1654,10 +1652,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
 	nand = devm_kzalloc(nc->dev,
 			    sizeof(*nand) + (numcs * sizeof(*nand->cs)),
 			    GFP_KERNEL);
-	if (!nand) {
-		dev_err(nc->dev, "Failed to allocate NAND object\n");
+	if (!nand)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	nand->numcs = numcs;
 
Signature · 1 line
2.15.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Fri, 5 Jan 2018 21:45:04 +0100

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

---

Quoted 21 lines
  drivers/mtd/nand/atmel/nand-controller.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mtd/nand/atmel/nand-controller.c +1 -3
index 90a71a56bc23..a41b999229c9 100644
@@ -1612,10 +1612,8 @@ static int atmel_nand_register(struct atmel_nand *nand)
  		mtd->name = devm_kasprintf(nc->dev, GFP_KERNEL,
  					   "%s:nand.%d", dev_name(nc->dev),
  					   nand->cs[0].id);
-		if (!mtd->name) {
-			dev_err(nc->dev, "Failed to allocate mtd->name\n");
+		if (!mtd->name)
  			return -ENOMEM;
-		}
  	}
 
  	ret = nand_scan_tail(mtd);
@@ -1654,10 +1652,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
  	nand = devm_kzalloc(nc->dev,

drivers/mtd/nand/atmel/nand-controller.c static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, · line 1659

Quoted 10 lines
drivers/mtd/nand/atmel/nand-controller.c +1 -3
  			    sizeof(*nand) + (numcs * sizeof(*nand->cs)),
  			    GFP_KERNEL);
-	if (!nand) {
-		dev_err(nc->dev, "Failed to allocate NAND object\n");
+	if (!nand)
  		return ERR_PTR(-ENOMEM);
-	}
 
  	nand->numcs = numcs;
 

Best Regards,
Wenyou Yang

#2 lore raw

PATCH 1/1 mtd/nand/atmel: Delete an error message for a failed memory allocation in two functions

[private message]
Hi Wenyou,

Quoted 4 lines · Wenyou
Quoted 3 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Fri, 5 Jan 2018 21:45:04 +0100

Quoted 8 lines
Quoted 6 lines

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

---

Please don't encourage Markus to send more patches. The MTD maintainers (like other maintainers) have decided to ignore his contributions.

If you want to know why, just google his name and you should have a pretty good idea.

Thanks,

Boris

Quoted 34 lines
Quoted 21 lines
  drivers/mtd/nand/atmel/nand-controller.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mtd/nand/atmel/nand-controller.c +1 -3
index 90a71a56bc23..a41b999229c9 100644
@@ -1612,10 +1612,8 @@ static int atmel_nand_register(struct atmel_nand *nand)
  		mtd->name = devm_kasprintf(nc->dev, GFP_KERNEL,
  					   "%s:nand.%d", dev_name(nc->dev),
  					   nand->cs[0].id);
-		if (!mtd->name) {
-			dev_err(nc->dev, "Failed to allocate mtd->name\n");
+		if (!mtd->name)
  			return -ENOMEM;
-		}
  	}
 
  	ret = nand_scan_tail(mtd);
@@ -1654,10 +1652,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
  	nand = devm_kzalloc(nc->dev,

drivers/mtd/nand/atmel/nand-controller.c static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, · line 1659

Quoted 10 lines
drivers/mtd/nand/atmel/nand-controller.c +1 -3
  			    sizeof(*nand) + (numcs * sizeof(*nand->cs)),
  			    GFP_KERNEL);
-	if (!nand) {
-		dev_err(nc->dev, "Failed to allocate NAND object\n");
+	if (!nand)
  		return ERR_PTR(-ENOMEM);
-	}
 
  	nand->numcs = numcs;
 

Best Regards,
Wenyou Yang

#3 lore raw

PATCH 1/1 mtd/nand/atmel: Delete an error message for a failed memory allocation in two functions

Quoted 1 line · On Mon, 8 Jan 2018 09:18:31 +0100 Boris Brezillon…

[private message]

Oops, not so private :-).

Quoted 63 lines

Hi Wenyou,

Quoted 4 lines · Wenyou
Quoted 3 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Fri, 5 Jan 2018 21:45:04 +0100

Quoted 8 lines
Quoted 6 lines

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

---

Please don't encourage Markus to send more patches. The MTD maintainers (like other maintainers) have decided to ignore his contributions.

If you want to know why, just google his name and you should have a pretty good idea.

Thanks,

Boris

Quoted 34 lines
Quoted 21 lines
  drivers/mtd/nand/atmel/nand-controller.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mtd/nand/atmel/nand-controller.c +1 -3
index 90a71a56bc23..a41b999229c9 100644
@@ -1612,10 +1612,8 @@ static int atmel_nand_register(struct atmel_nand *nand)
  		mtd->name = devm_kasprintf(nc->dev, GFP_KERNEL,
  					   "%s:nand.%d", dev_name(nc->dev),
  					   nand->cs[0].id);
-		if (!mtd->name) {
-			dev_err(nc->dev, "Failed to allocate mtd->name\n");
+		if (!mtd->name)
  			return -ENOMEM;
-		}
  	}
 
  	ret = nand_scan_tail(mtd);
@@ -1654,10 +1652,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
  	nand = devm_kzalloc(nc->dev,

drivers/mtd/nand/atmel/nand-controller.c static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, · line 1659

Quoted 10 lines
drivers/mtd/nand/atmel/nand-controller.c +1 -3
  			    sizeof(*nand) + (numcs * sizeof(*nand->cs)),
  			    GFP_KERNEL);
-	if (!nand) {
-		dev_err(nc->dev, "Failed to allocate NAND object\n");
+	if (!nand)
  		return ERR_PTR(-ENOMEM);
-	}
 
  	nand->numcs = numcs;
 

Best Regards,
Wenyou Yang