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: 10194825 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 32CE860380 for ; Wed, 31 Jan 2018 21:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CFB228880 for ; Wed, 31 Jan 2018 21:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BABF288A2; Wed, 31 Jan 2018 21:11:22 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A734F288CF for ; Wed, 31 Jan 2018 21:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject: From:To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1Wg/HnkaWPcV/gnXs7OfyQAtIcSxwzfOtHSYlC1eumI=; b=jZts26nCLERof5 hyYMI+I7WyxYxGLZWE9vaPSJ3aYfXyX0HCRlI2C6edu0/jZZ9v1GFzd2BbJsNW0kCgGYZA68o8KKF TwoAwpElQqAVcUmQ4cQhcJOgOf8jG9B9ovWRyFd3zAL4z4mt9s5pl0qPqI1LBb7qDchUNqhCwqaC7 JEEcN/heGg7WlBpRdxztvjgt77IccFN/Pf+MtODqu9INpB0/AbBRPoXM5/zXjbTiq3mzR1UvwcFHE 7BS18UURoWpmSilth4DjIRo0I+SAP8pkB4onCBw0DnBTAKTlnbLJDm8EeK0uEAV7fEwTa8NwWnPmz wERM6P+A5pnyVDWNmSJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egzf2-0003EO-UI; Wed, 31 Jan 2018 21:11:16 +0000 Received: from mout.web.de ([212.227.15.14]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egzez-0003Dd-Nx for linux-arm-kernel@lists.infradead.org; Wed, 31 Jan 2018 21:11:15 +0000 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 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/4mqzE2XwH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/EuplC1xxq97Uw/lo6yeKUK8= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);