Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935493AbeAHRJm (ORCPT + 1 other); Mon, 8 Jan 2018 12:09:42 -0500 Received: from mout.web.de ([212.227.15.4]:62137 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932277AbeAHRJk (ORCPT ); Mon, 8 Jan 2018 12:09:40 -0500 To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman Cc: LKML From: SF Markus Elfring Subject: [PATCH] misc/lattice-ecp3-config: Delete an error message for a failed memory allocation in two functions Message-ID: <293c6ae3-7b1e-690c-7ac0-352dee270e32@users.sourceforge.net> Date: Mon, 8 Jan 2018 18:09:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ik2LH2Zigk8UE5mVUKMaKmdFfOcoJwsGAmTcSo4Zzeom73/N6Ze 0Hh1Yit5CXcdTgxL4LLn9JG2rag5alHq3UU7a/GDPuQvOD3lUNl+R2rCThV7OuH/2BL19Fi 0trOh5LCXJyNJ3V3nGPUt/Wba4OvoU2YnrddxMhDYgtVPUTSVUY+yaFld7iSmYGKXlV99JI SDdTt/qcUPyluviGnZWgA== X-UI-Out-Filterresults: notjunk:1;V01:K0:KX6sFH/n9ec=:/5SK0rR6lWIZeHEoxzpKGx OpGYVvmajoY2Zq5JiUivcvDYO+1V8DhBV/mgZZY2jwuNCJSere/BnVkA5dxrJE+0PdnShR7tH UQjCAXmXQFtODu/T/c4ydZSkc/xSVrxXZZaQPXDZYs+sVCpd5lub79dcBskItsbrPk/CqoxPV mexhweKUcsHWYQJAYIxDernwWfI24KtTKncJ8CwdtdWxwoq2jR6/aBBwJcC2ylfncHvzZR2AL YpObO7WijNAeHdz+s9N7C0VXGEQGRFJxPzEDzeehBY3XJV5U9yTr/u9lSfvHk0Y8PvV7C1G31 L+2lMQX0o7JvN8ImnYRMXaLLGgJC+OWYGePkNyfe3BnEuAP6FVNJqzdU2g1F/0xF/JjOyAHxb zBalBs+QWYyfL4AghkoW0Q3jT5h5DPRPfAQEX1KscxcigMr6xQ9OJqcE/Go/uZ4NnzqsTBu22 fM7szWC/W7ztTYtqdj0s/F9wkVJg4qgkp2mO51ffa5DUPeY+I5Icz/11c6jG2BLlMFXwIEjE/ iieTZnbR1STjCZrU8hkiK/SL+bVINyc4sOEg05J8jZU7xX2oc9P9slN6EAAuc4r8pZI5nnek0 /FgXrqSWQMIj6EA+NEylAt2JCXbuLkdCDaY19gF7U/nhR17e1UIiHEg4aFhtju84R4aFrczi/ X9sjx+zvAeWm4ZK8GIcjVgVNLd23X1etM6kdIUAYXtVHoKL93EMRQQDCkMNHSzpDgGiYEHw4G XFO1mNTw9e+7De6Uyx8RsENcU7hsr9MvJpnImbQL+oZO85OmEu6CBQODKxiGWh+DwwGGUB3im oQm0XuN/PAy4P64RLChWODrK/VarjMB3siBbh+UfF45f/FTijI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring 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 --- 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