From patchwork Wed Jan 31 21:10:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10194827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28BFF60380 for ; Wed, 31 Jan 2018 21:11:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EFA328880 for ; Wed, 31 Jan 2018 21:11:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D54828897; Wed, 31 Jan 2018 21:11:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6C5E288B2 for ; Wed, 31 Jan 2018 21:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752740AbeAaVLW (ORCPT ); Wed, 31 Jan 2018 16:11:22 -0500 Received: from mout.web.de ([212.227.15.14]:54978 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbeAaVLV (ORCPT ); Wed, 31 Jan 2018 16:11:21 -0500 Received: from [192.168.1.2] ([77.182.166.142]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MbMg8-1eQZEB2sZ2-00IlEg; Wed, 31 Jan 2018 22:10:39 +0100 To: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alexandre Belloni , Colin Ian King , Hartmut Knaack , Jonathan Cameron , Lars-Peter Clausen , Nicolas Ferre , Peter Meerwald-Stadler , Philippe Reynes , Simran Singhal From: SF Markus Elfring Subject: [PATCH] iio/adc: Delete an error message for a failed memory allocation in two functions Cc: LKML , kernel-janitors@vger.kernel.org Message-ID: <0a3e6b48-f837-ce30-4adf-28ce5d885c24@users.sourceforge.net> Date: Wed, 31 Jan 2018 22:10:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:g0/NI6b03TZYNm6U6xbd0V5Vp8r3MvL/4mqzE2XwHfGFqy/byH/ N4lx00TmQMaG52qjuTlY0KZ0fT7IpqGBxlZHGAmmya7WHYTxBz+Dgx8I4kC1ACJQ2Ei1YV3 LW3CmZsOHsueZ3Wpj4Ew60crMS9StURYlmmI262c+dnU+1nKkk3RtGYfCz8fpuL7nVYJ2qq SLVP3+n/ps2oIa1+//cgw== X-UI-Out-Filterresults: notjunk:1; V01:K0:4/NfD6kdT1M=:fmcqp0Aiwnw8uP9usov19i /Ijtge2UdZyfKT6BoTUiPYu0IS74tyyVmuY3hQ6lMNNs7lmHr2bAk0hmE0wqvjmPloBbO0qYw aeuW1Y2YCVw8xlQikHdUgc7k0MrYQqhBhlFdTDgvGOlxCwTthKecCXlMD32+YZWnGotQUaGKr IVvMzv4LQA7nDcGxolX1WyehxLlWsQuvOJSLEn6sxUlP+IR5f7U+P2YBU3FNyFeOQA9SsEHgK dFP9xGyiFMXoDgXZuaEEcM8M46EstxQxhXIO5UV9ZjMtQ/jODo06lfjqauCnrdQSxt2s1huyF qNGaQVIlVfUAaNGEHvWbm54CVhmhN+ket4SM9yolNaO8KpQLy/v847Ulm7CKajhNr3XaBHHiX JtK5fva3zaUlIc5RChz2jeM2oCgVzWZlu1Jt9uYkCWffE1oanOVz+t2bJKya+5T0ZXJH+VM7r WN8EZrbdmYUMgN1VgH5miOUZSRVU7xMRA+yk9RBNYkNoBOqJEj3K829O/5kdjMWsJsP4WFYvr gsfQclpypBrxKyUnnXzPFIEMQ7OhHYlXHHtE0Q49eBX4Q0fR/uakORxRXdnbgQR07rRUiiGAO Tbbwz8G5N97LVaOWMrh70q0KrdrIq369p0Fb78Z5ZpJe19/0WNinpp0xDTAa5zHItU1ZRtuOe /0rUwQ3YdK9tIKpgjW0VV2bpGjzhjJiTONxkfX9DXdQjpXGX3NjWiCN+a5vUsie4xPpl4TnP2 2cN+m/HMtB2lmDwg2p3XBErWTML7yeMzhmzjB8vnY7bSh7OVPNik5roh/+YO4aje1jrqog5SK msIvR6K1pxKKQol1HUtNOoag6r/EuplC1xxq97Uw/lo6yeKUK8= Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 31 Jan 2018 21:57:50 +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/iio/adc/at91_adc.c | 1 - drivers/iio/adc/max1027.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 3836d4222a3e..ce37cfeb8d1c 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -912,7 +912,6 @@ static int at91_adc_probe_dt(struct at91_adc_state *st, sizeof(struct at91_adc_trigger), GFP_KERNEL); if (!st->trigger_list) { - dev_err(&idev->dev, "Could not allocate trigger list memory.\n"); ret = -ENOMEM; goto error_ret; } diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index 375da6491499..74b305c775f2 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -425,10 +425,8 @@ static int max1027_probe(struct spi_device *spi) st->buffer = devm_kmalloc(&indio_dev->dev, indio_dev->num_channels * 2, GFP_KERNEL); - if (st->buffer == NULL) { - dev_err(&indio_dev->dev, "Can't allocate buffer\n"); + if (!st->buffer) return -ENOMEM; - } ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time, &max1027_trigger_handler, NULL);