diff mbox

input/rmi4: Delete an error message for a failed memory allocation in two functions

Message ID 423a3ec4-eef2-f663-d6b8-9ec9d31ddfc2@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Jan. 24, 2018, 6:28 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 19:19:14 +0100

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

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/input/rmi4/rmi_driver.c | 4 +---
 drivers/input/rmi4/rmi_f30.c    | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

Comments

Nick Dyer Jan. 24, 2018, 8:36 p.m. UTC | #1
On Wed, Jan 24, 2018 at 07:28:44PM +0100, SF Markus Elfring wrote:
> Omit an extra message for a memory allocation failure in these functions.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Signed-off-by: Nick Dyer <nick@shmanahar.org>

> ---
>  drivers/input/rmi4/rmi_driver.c | 4 +---
>  drivers/input/rmi4/rmi_f30.c    | 4 +---
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 4f2bb5947a4e..6c47e4f3ca7e 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -1060,10 +1060,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
>  
>  	size = BITS_TO_LONGS(data->irq_count) * sizeof(unsigned long);
>  	data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
> -	if (!data->irq_memory) {
> -		dev_err(dev, "Failed to allocate memory for irq masks.\n");
> +	if (!data->irq_memory)
>  		return -ENOMEM;
> -	}
>  
>  	data->irq_status	= data->irq_memory + size * 0;
>  	data->fn_irq_bits	= data->irq_memory + size * 1;
> diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c
> index 82e0f0d43d55..a111ea370c30 100644
> --- a/drivers/input/rmi4/rmi_f30.c
> +++ b/drivers/input/rmi4/rmi_f30.c
> @@ -238,10 +238,8 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
>  					    button_count,
>  					    sizeof(f30->gpioled_key_map[0]),
>  					    GFP_KERNEL);
> -	if (!f30->gpioled_key_map) {
> -		dev_err(&fn->dev, "Failed to allocate gpioled map memory.\n");
> +	if (!f30->gpioled_key_map)
>  		return -ENOMEM;
> -	}
>  
>  	for (i = 0; i < button_count; i++) {
>  		if (!rmi_f30_is_valid_button(i, f30->ctrl))
> -- 
> 2.16.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 4f2bb5947a4e..6c47e4f3ca7e 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -1060,10 +1060,8 @@  int rmi_probe_interrupts(struct rmi_driver_data *data)
 
 	size = BITS_TO_LONGS(data->irq_count) * sizeof(unsigned long);
 	data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
-	if (!data->irq_memory) {
-		dev_err(dev, "Failed to allocate memory for irq masks.\n");
+	if (!data->irq_memory)
 		return -ENOMEM;
-	}
 
 	data->irq_status	= data->irq_memory + size * 0;
 	data->fn_irq_bits	= data->irq_memory + size * 1;
diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c
index 82e0f0d43d55..a111ea370c30 100644
--- a/drivers/input/rmi4/rmi_f30.c
+++ b/drivers/input/rmi4/rmi_f30.c
@@ -238,10 +238,8 @@  static int rmi_f30_map_gpios(struct rmi_function *fn,
 					    button_count,
 					    sizeof(f30->gpioled_key_map[0]),
 					    GFP_KERNEL);
-	if (!f30->gpioled_key_map) {
-		dev_err(&fn->dev, "Failed to allocate gpioled map memory.\n");
+	if (!f30->gpioled_key_map)
 		return -ENOMEM;
-	}
 
 	for (i = 0; i < button_count; i++) {
 		if (!rmi_f30_is_valid_button(i, f30->ctrl))