All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe()
@ 2017-12-08 19:00 ` SF Markus Elfring
  0 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-08 19:00 UTC (permalink / raw)
  To: linux-serial, Alexander Shiyan, Greg Kroah-Hartman, Jiri Slaby
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 19:53:10 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/tty/serial/max310x.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index ecb6513a6505..2aad36f402fd 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -1102,10 +1102,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
 	/* Alloc port structure */
 	s = devm_kzalloc(dev, sizeof(*s) +
 			 sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
-	if (!s) {
-		dev_err(dev, "Error allocating port structure\n");
+	if (!s)
 		return -ENOMEM;
-	}
 
 	clk_osc = devm_clk_get(dev, "osc");
 	clk_xtal = devm_clk_get(dev, "xtal");
-- 
2.15.1

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

* [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe()
@ 2017-12-08 19:00 ` SF Markus Elfring
  0 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-08 19:00 UTC (permalink / raw)
  To: linux-serial, Alexander Shiyan, Greg Kroah-Hartman, Jiri Slaby
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 19:53:10 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/tty/serial/max310x.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index ecb6513a6505..2aad36f402fd 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -1102,10 +1102,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
 	/* Alloc port structure */
 	s = devm_kzalloc(dev, sizeof(*s) +
 			 sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
-	if (!s) {
-		dev_err(dev, "Error allocating port structure\n");
+	if (!s)
 		return -ENOMEM;
-	}
 
 	clk_osc = devm_clk_get(dev, "osc");
 	clk_xtal = devm_clk_get(dev, "xtal");
-- 
2.15.1


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

* Re: [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe()
  2017-12-08 19:00 ` SF Markus Elfring
  (?)
@ 2017-12-08 19:52   ` Jan Kundrát
  -1 siblings, 0 replies; 5+ messages in thread
From: Jan Kundrát @ 2017-12-08 19:52 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-serial, Alexander Shiyan, Greg Kroah-Hartman, Jiri Slaby,
	LKML, kernel-janitors

On pátek 8. prosince 2017 20:00:34 CET, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 8 Dec 2017 19:53:10 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/tty/serial/max310x.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index ecb6513a6505..2aad36f402fd 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -1102,10 +1102,8 @@ static int max310x_probe(struct device 
> *dev, struct max310x_devtype *devtype,
>  	/* Alloc port structure */
>  	s = devm_kzalloc(dev, sizeof(*s) +
>  			 sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
> -	if (!s) {
> -		dev_err(dev, "Error allocating port structure\n");
> +	if (!s)
>  		return -ENOMEM;
> -	}
>  
>  	clk_osc = devm_clk_get(dev, "osc");
>  	clk_xtal = devm_clk_get(dev, "xtal");

I'm looking at this patch because I'm also making some modifications to 
this driver. This patch makes sense; other drivers also simply return 
ENOMEM. Tested on ARM, Armada 388; the "good" code path still obviously 
works :).

Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>

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

* Re: [PATCH] serial: max310x: Delete an error message for a failed =?iso-8859-1?Q?memory_allocation_i
@ 2017-12-08 19:52   ` Jan Kundrát
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kundrát @ 2017-12-08 19:52 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-serial, Alexander Shiyan, Greg Kroah-Hartman, Jiri Slaby,
	LKML, kernel-janitors

On pátek 8. prosince 2017 20:00:34 CET, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 8 Dec 2017 19:53:10 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/tty/serial/max310x.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index ecb6513a6505..2aad36f402fd 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -1102,10 +1102,8 @@ static int max310x_probe(struct device 
> *dev, struct max310x_devtype *devtype,
>  	/* Alloc port structure */
>  	s = devm_kzalloc(dev, sizeof(*s) +
>  			 sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
> -	if (!s) {
> -		dev_err(dev, "Error allocating port structure\n");
> +	if (!s)
>  		return -ENOMEM;
> -	}
>  
>  	clk_osc = devm_clk_get(dev, "osc");
>  	clk_xtal = devm_clk_get(dev, "xtal");

I'm looking at this patch because I'm also making some modifications to 
this driver. This patch makes sense; other drivers also simply return 
ENOMEM. Tested on ARM, Armada 388; the "good" code path still obviously 
works :).

Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>

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

* Re: [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe()
@ 2017-12-08 19:52   ` Jan Kundrát
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kundrát @ 2017-12-08 19:52 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-serial, Alexander Shiyan, Greg Kroah-Hartman, Jiri Slaby,
	LKML, kernel-janitors

On pátek 8. prosince 2017 20:00:34 CET, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 8 Dec 2017 19:53:10 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/tty/serial/max310x.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index ecb6513a6505..2aad36f402fd 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -1102,10 +1102,8 @@ static int max310x_probe(struct device 
> *dev, struct max310x_devtype *devtype,
>  	/* Alloc port structure */
>  	s = devm_kzalloc(dev, sizeof(*s) +
>  			 sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
> -	if (!s) {
> -		dev_err(dev, "Error allocating port structure\n");
> +	if (!s)
>  		return -ENOMEM;
> -	}
>  
>  	clk_osc = devm_clk_get(dev, "osc");
>  	clk_xtal = devm_clk_get(dev, "xtal");

I'm looking at this patch because I'm also making some modifications to 
this driver. This patch makes sense; other drivers also simply return 
ENOMEM. Tested on ARM, Armada 388; the "good" code path still obviously 
works :).

Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>

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

end of thread, other threads:[~2017-12-08 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 19:00 [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe() SF Markus Elfring
2017-12-08 19:00 ` SF Markus Elfring
2017-12-08 19:52 ` Jan Kundrát
2017-12-08 19:52   ` Jan Kundrát
2017-12-08 19:52   ` [PATCH] serial: max310x: Delete an error message for a failed =?iso-8859-1?Q?memory_allocation_i Jan Kundrát

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.