mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] misc/lattice-ecp3-config: Delete an error message for a failed memory allocation in two functions
@ 2018-01-08 17:09 SF Markus Elfring
  0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2018-01-08 17:09 UTC (permalink / raw)
  To: kernel-janitors, Arnd Bergmann, Greg Kroah-Hartman; +Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 Jan 2018 18:01:39 +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/misc/lattice-ecp3-config.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c
index 626fdcaf2510..8aa60907ced4 100644
--- a/drivers/misc/lattice-ecp3-config.c
+++ b/drivers/misc/lattice-ecp3-config.c
@@ -119,10 +119,8 @@ static void firmware_load(const struct firmware *fw, void *context)
 	dev_dbg(&spi->dev, "FPGA Status=%08x\n", status);
 
 	buffer = kzalloc(fw->size + 8, GFP_KERNEL);
-	if (!buffer) {
-		dev_err(&spi->dev, "Error: Can't allocate memory!\n");
+	if (!buffer)
 		return;
-	}
 
 	/*
 	 * Insert WRITE_INC command into stream (one SPI frame)
@@ -196,10 +194,9 @@ static int lattice_ecp3_probe(struct spi_device *spi)
 	int err;
 
 	data = devm_kzalloc(&spi->dev, sizeof(*data), GFP_KERNEL);
-	if (!data) {
-		dev_err(&spi->dev, "Memory allocation for fpga_data failed\n");
+	if (!data)
 		return -ENOMEM;
-	}
+
 	spi_set_drvdata(spi, data);
 
 	init_completion(&data->fw_loaded);
-- 
2.15.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-08 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-08 17:09 [PATCH] misc/lattice-ecp3-config: Delete an error message for a failed memory allocation in two functions SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome