From patchwork Wed Oct 4 11:11:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9984249 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 BEBD160237 for ; Wed, 4 Oct 2017 11:12:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0DCC28A87 for ; Wed, 4 Oct 2017 11:12:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A56AD28ACB; Wed, 4 Oct 2017 11:12:51 +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 3362E28A87 for ; Wed, 4 Oct 2017 11:12:50 +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:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TzdxmBXeOovhKqATSWd2+6fyrxf4pILSlSmyr+742Wg=; b=tbi8Gv6dwecunH vfOuQGzYiycu97pwOj+Vxc6RkvsV0mmQKCEKHrJMQohM8Hc5w8I+DV0YT/CRqPKD3OA2v9I4fBF9k 8nN50cpD0SHhOWcuHH7OZGGRP74qMQmzQvIyoEJOeGz1NRWiP8LLoDYx+v633ajGQEuEZib3XEUOw 3xpUAQa7dy59mCZnC4oNVj2bnYx7XYZue0sGRD6VQmEP+LPAn0n9HwGrVWSO4R+GnJXCQ/mrLfNpR P9CRw48Anv2bZQIhjyFxLxBgo2dpbGXfiHn4iNfRNXOktl5AbacCGYgnzCCITQsFSJIYVgceeauDv Uy3rgxUARE1ZnQ/7ugmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dzhbG-00061W-Aq; Wed, 04 Oct 2017 11:12:26 +0000 Received: from mout.web.de ([212.227.15.4]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dzhbB-0005sz-PB for linux-arm-kernel@lists.infradead.org; Wed, 04 Oct 2017 11:12:24 +0000 Received: from [192.168.1.2] ([92.228.164.50]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lcxjk-1dZCSj31Rg-00iDbt; Wed, 04 Oct 2017 13:11:58 +0200 Subject: [PATCH 1/2] ARM: SAMSUNG: Delete an error message for a failed memory allocation in three functions From: SF Markus Elfring To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , Kukjin Kim , Russell King References: <75c352ad-c51e-2e63-2f93-0f14522ff09c@users.sourceforge.net> Message-ID: Date: Wed, 4 Oct 2017 13:11:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <75c352ad-c51e-2e63-2f93-0f14522ff09c@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:vbPw9yPrGWMovg9CFi9NlH2k/nDOQ3YcPebOCo4zRN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DvemkTUfkZR4F5E= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171004_041222_268233_941EAF58 X-CRM114-Status: GOOD ( 11.25 ) 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, 4 Oct 2017 09:33:52 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/arm/plat-samsung/adc.c | 8 ++------ arch/arm/plat-samsung/platformdata.c | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index daf3db9f0058..f8d6206e4daa 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c @@ -239,10 +239,8 @@ struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, return ERR_PTR(-EINVAL); client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL); - if (!client) { - dev_err(&pdev->dev, "no memory for adc client\n"); + if (!client) return ERR_PTR(-ENOMEM); - } client->pdev = pdev; client->is_ts = is_ts; @@ -345,10 +343,8 @@ static int s3c_adc_probe(struct platform_device *pdev) unsigned tmp; adc = devm_kzalloc(dev, sizeof(struct adc_device), GFP_KERNEL); - if (adc == NULL) { - dev_err(dev, "failed to allocate adc_device\n"); + if (!adc) return -ENOMEM; - } spin_lock_init(&adc->lock); diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c index b430e9946287..6cf52ee7eeec 100644 --- a/arch/arm/plat-samsung/platformdata.c +++ b/arch/arm/plat-samsung/platformdata.c @@ -29,10 +29,8 @@ void __init *s3c_set_platdata(void *pd, size_t pdsize, } npd = kmemdup(pd, pdsize, GFP_KERNEL); - if (!npd) { - printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name); + if (!npd) return NULL; - } pdev->dev.platform_data = npd; return npd;