linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mtd: nand: Remove print after allocation failure
@ 2018-03-14 15:35 Arushi Singhal
  2018-03-14 15:35 ` [PATCH 2/3] mtd: maps: " Arushi Singhal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arushi Singhal @ 2018-03-14 15:35 UTC (permalink / raw)
  To: dwmw2
  Cc: computersforpeace, boris.brezillon, marek.vasut, richard,
	cyrille.pitchen, linux-mtd, linux-kernel, Arushi Singhal

The prints after [k|v][m|z|c]alloc() functions are not needed, because
in case of failure, allocator will print their internal error prints
anyway.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/mtd/nand/ams-delta.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 9de6572..6e7f6e0 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -185,7 +185,6 @@ static int ams_delta_init(struct platform_device *pdev)
 	/* Allocate memory for MTD device structure and private data */
 	this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
 	if (!this) {
-		printk (KERN_WARNING "Unable to allocate E3 NAND MTD device structure.\n");
 		err = -ENOMEM;
 		goto out;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] mtd: maps: Remove print after allocation failure
  2018-03-14 15:35 [PATCH 1/3] mtd: nand: Remove print after allocation failure Arushi Singhal
@ 2018-03-14 15:35 ` Arushi Singhal
  2018-03-15 16:07   ` Boris Brezillon
  2018-03-14 15:35 ` [PATCH 3/3] mtd: " Arushi Singhal
  2018-03-15 16:01 ` [PATCH 1/3] mtd: nand: " Boris Brezillon
  2 siblings, 1 reply; 6+ messages in thread
From: Arushi Singhal @ 2018-03-14 15:35 UTC (permalink / raw)
  To: dwmw2
  Cc: computersforpeace, boris.brezillon, marek.vasut, richard,
	cyrille.pitchen, linux-mtd, linux-kernel, Arushi Singhal

The prints after [k|v][m|z|c]alloc() functions are not needed, because
in case of failure, allocator will print their internal error prints
anyway.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/mtd/maps/sun_uflash.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index 1e73bba..80a253c 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -62,10 +62,8 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)
 	}
 
 	up = kzalloc(sizeof(struct uflash_dev), GFP_KERNEL);
-	if (!up) {
-		printk(KERN_ERR PFX "Cannot allocate struct uflash_dev\n");
+	if (!up)
 		return -ENOMEM;
-	}
 
 	/* copy defaults and tweak parameters */
 	memcpy(&up->map, &uflash_map_templ, sizeof(uflash_map_templ));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] mtd: Remove print after allocation failure
  2018-03-14 15:35 [PATCH 1/3] mtd: nand: Remove print after allocation failure Arushi Singhal
  2018-03-14 15:35 ` [PATCH 2/3] mtd: maps: " Arushi Singhal
@ 2018-03-14 15:35 ` Arushi Singhal
  2018-03-15 16:10   ` Boris Brezillon
  2018-03-15 16:01 ` [PATCH 1/3] mtd: nand: " Boris Brezillon
  2 siblings, 1 reply; 6+ messages in thread
From: Arushi Singhal @ 2018-03-14 15:35 UTC (permalink / raw)
  To: dwmw2
  Cc: computersforpeace, boris.brezillon, marek.vasut, richard,
	cyrille.pitchen, linux-mtd, linux-kernel, Arushi Singhal

The prints after [k|v][m|z|c]alloc() functions are not needed, because
in case of failure, allocator will print their internal error prints
anyway.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/mtd/inftlmount.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 8d6bb189..6b94646 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -562,12 +562,8 @@ int INFTL_mount(struct INFTLrecord *s)
 
 	/* Temporary buffer to store ANAC numbers. */
 	ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
-	if (!ANACtable) {
-		printk(KERN_WARNING "INFTL: allocation of ANACtable "
-				"failed (%zd bytes)\n",
-				s->nb_blocks * sizeof(u8));
+	if (!ANACtable)
 		return -ENOMEM;
-	}
 
 	/*
 	 * First pass is to explore each physical unit, and construct the
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] mtd: nand: Remove print after allocation failure
  2018-03-14 15:35 [PATCH 1/3] mtd: nand: Remove print after allocation failure Arushi Singhal
  2018-03-14 15:35 ` [PATCH 2/3] mtd: maps: " Arushi Singhal
  2018-03-14 15:35 ` [PATCH 3/3] mtd: " Arushi Singhal
@ 2018-03-15 16:01 ` Boris Brezillon
  2 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-03-15 16:01 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: dwmw2, boris.brezillon, richard, linux-kernel, marek.vasut,
	linux-mtd, cyrille.pitchen, computersforpeace

On Wed, 14 Mar 2018 21:05:16 +0530
Arushi Singhal <arushisinghal19971997@gmail.com> wrote:

> The prints after [k|v][m|z|c]alloc() functions are not needed, because
> in case of failure, allocator will print their internal error prints
> anyway.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/mtd/nand/ams-delta.c | 1 -

You miss quite a few of them (atmel, nandsim, sunxi_nand at least,
there might be others).

>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
> index 9de6572..6e7f6e0 100644
> --- a/drivers/mtd/nand/ams-delta.c
> +++ b/drivers/mtd/nand/ams-delta.c
> @@ -185,7 +185,6 @@ static int ams_delta_init(struct platform_device *pdev)
>  	/* Allocate memory for MTD device structure and private data */
>  	this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
>  	if (!this) {
> -		printk (KERN_WARNING "Unable to allocate E3 NAND MTD device structure.\n");
>  		err = -ENOMEM;
>  		goto out;
>  	}



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] mtd: maps: Remove print after allocation failure
  2018-03-14 15:35 ` [PATCH 2/3] mtd: maps: " Arushi Singhal
@ 2018-03-15 16:07   ` Boris Brezillon
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-03-15 16:07 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: dwmw2, boris.brezillon, richard, linux-kernel, marek.vasut,
	linux-mtd, cyrille.pitchen, computersforpeace

Hi Arushi,

On Wed, 14 Mar 2018 21:05:17 +0530
Arushi Singhal <arushisinghal19971997@gmail.com> wrote:

> The prints after [k|v][m|z|c]alloc() functions are not needed, because
> in case of failure, allocator will print their internal error prints
> anyway.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/mtd/maps/sun_uflash.c | 4 +---

And here as well some of the drivers are still printing error messages
after mem allocation failures (amd76xrom, ck804xrom, esb2rom, ichxrom,
vmu-flash).

Regards,

Boris

>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
> index 1e73bba..80a253c 100644
> --- a/drivers/mtd/maps/sun_uflash.c
> +++ b/drivers/mtd/maps/sun_uflash.c
> @@ -62,10 +62,8 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)
>  	}
>  
>  	up = kzalloc(sizeof(struct uflash_dev), GFP_KERNEL);
> -	if (!up) {
> -		printk(KERN_ERR PFX "Cannot allocate struct uflash_dev\n");
> +	if (!up)
>  		return -ENOMEM;
> -	}
>  
>  	/* copy defaults and tweak parameters */
>  	memcpy(&up->map, &uflash_map_templ, sizeof(uflash_map_templ));



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] mtd: Remove print after allocation failure
  2018-03-14 15:35 ` [PATCH 3/3] mtd: " Arushi Singhal
@ 2018-03-15 16:10   ` Boris Brezillon
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-03-15 16:10 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: dwmw2, boris.brezillon, richard, linux-kernel, marek.vasut,
	linux-mtd, cyrille.pitchen, computersforpeace

Hi Arushi,

On Wed, 14 Mar 2018 21:05:18 +0530
Arushi Singhal <arushisinghal19971997@gmail.com> wrote:

> The prints after [k|v][m|z|c]alloc() functions are not needed, because
> in case of failure, allocator will print their internal error prints
> anyway.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/mtd/inftlmount.c | 6 +-----

I didn't check but I'm pretty sure you missed some of them here too.

>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
> index 8d6bb189..6b94646 100644
> --- a/drivers/mtd/inftlmount.c
> +++ b/drivers/mtd/inftlmount.c
> @@ -562,12 +562,8 @@ int INFTL_mount(struct INFTLrecord *s)
>  
>  	/* Temporary buffer to store ANAC numbers. */
>  	ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
> -	if (!ANACtable) {
> -		printk(KERN_WARNING "INFTL: allocation of ANACtable "
> -				"failed (%zd bytes)\n",
> -				s->nb_blocks * sizeof(u8));
> +	if (!ANACtable)
>  		return -ENOMEM;
> -	}
>  
>  	/*
>  	 * First pass is to explore each physical unit, and construct the



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-15 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 15:35 [PATCH 1/3] mtd: nand: Remove print after allocation failure Arushi Singhal
2018-03-14 15:35 ` [PATCH 2/3] mtd: maps: " Arushi Singhal
2018-03-15 16:07   ` Boris Brezillon
2018-03-14 15:35 ` [PATCH 3/3] mtd: " Arushi Singhal
2018-03-15 16:10   ` Boris Brezillon
2018-03-15 16:01 ` [PATCH 1/3] mtd: nand: " Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).