From patchwork Wed Dec 13 17:33:34 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: 10110477 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 3F9AE60327 for ; Wed, 13 Dec 2017 17:34:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2764128D9E for ; Wed, 13 Dec 2017 17:34:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B9CC28DEC; Wed, 13 Dec 2017 17:34:05 +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 8CEA328D9E for ; Wed, 13 Dec 2017 17:34:04 +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=Cf6sBYWaqas8zc34zZIi0sjJ1u9c5XjYCa4miaVPj7s=; b=ursMfeatdN9/v1 juGoBkiVcRgZfSGkNCAUSWuNekS+M28jXKuGUtnPCOmo+HIYtHfhaT0XxEws1scUREVzQfSxsxFhP q6XelHpglDoWW3PbIWSiuB5OxcufPgnPRavfi2pc/csBLRMFd7D4/t7OcfsbhnJnQbSjy7FiuP6td UKSo5ksy5otm8rKQH2A7hyjVBU4QuTaT4XfVznirnPpYVkaF1FFSrpg2Ze5pBa4qDHPK/WD8VG5d2 AlzP/bhrGmSlNkLwcPNiJeJ1UXAmUs8ZOhDleekuvImw/uKoUMaJ5Q8GHDFsbbSsoHeazEpqoJIbD PdT4LA+oLF0WxtYSURdg==; 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 1ePAuy-0001m7-8k; Wed, 13 Dec 2017 17:34:04 +0000 Received: from mout.web.de ([212.227.15.4]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePAuu-0001kH-LS for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2017 17:34:02 +0000 Received: from [192.168.1.3] ([77.181.208.154]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lcxjk-1epg1X2PU8-00iAr5; Wed, 13 Dec 2017 18:33:35 +0100 Subject: [PATCH 1/3] soc/fsl/qe: Delete an error message for a failed memory allocation in three functions From: SF Markus Elfring To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Li Yang , Qiang Zhao References: <07738369-a787-98b4-41a5-71b7d630c356@users.sourceforge.net> Message-ID: Date: Wed, 13 Dec 2017 18:33:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <07738369-a787-98b4-41a5-71b7d630c356@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:+UUx2aMua3OVU+bRiVdyZvnE9KU2pIQY4rWPTlGxlnMXfb66uwc BBhne9TjLeOWIh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M114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_093401_048619_D7D84212 X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. 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, 13 Dec 2017 17:45:23 +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/soc/fsl/qe/gpio.c | 4 +--- drivers/soc/fsl/qe/ucc_fast.c | 5 +---- drivers/soc/fsl/qe/ucc_slow.c | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 3b27075c21a7..9239cf176e67 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -143,10 +143,8 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) unsigned long flags; qe_pin = kzalloc(sizeof(*qe_pin), GFP_KERNEL); - if (!qe_pin) { - pr_debug("%s: can't allocate memory\n", __func__); + if (!qe_pin) return ERR_PTR(-ENOMEM); - } err = of_get_gpio(np, index); if (err < 0) diff --git a/drivers/soc/fsl/qe/ucc_fast.c b/drivers/soc/fsl/qe/ucc_fast.c index 83d8d16e3a69..59b68bf4aebb 100644 --- a/drivers/soc/fsl/qe/ucc_fast.c +++ b/drivers/soc/fsl/qe/ucc_fast.c @@ -195,11 +195,8 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc } uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); - if (!uccf) { - printk(KERN_ERR "%s: Cannot allocate private data\n", - __func__); + if (!uccf) return -ENOMEM; - } /* Fill fast UCC structure */ uccf->uf_info = uf_info; diff --git a/drivers/soc/fsl/qe/ucc_slow.c b/drivers/soc/fsl/qe/ucc_slow.c index 9334bdbd9b30..fc91412e2300 100644 --- a/drivers/soc/fsl/qe/ucc_slow.c +++ b/drivers/soc/fsl/qe/ucc_slow.c @@ -153,11 +153,8 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc } uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); - if (!uccs) { - printk(KERN_ERR "%s: Cannot allocate private data\n", - __func__); + if (!uccs) return -ENOMEM; - } /* Fill slow UCC structure */ uccs->us_info = us_info;