From patchwork Tue Feb 13 20:40:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 10217555 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 7713C6055C for ; Tue, 13 Feb 2018 20:40:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 675A128F0B for ; Tue, 13 Feb 2018 20:40:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BE8B28F11; Tue, 13 Feb 2018 20:40:38 +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 D583C28F0B for ; Tue, 13 Feb 2018 20:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965733AbeBMUkh (ORCPT ); Tue, 13 Feb 2018 15:40:37 -0500 Received: from smtprelay0065.hostedemail.com ([216.40.44.65]:46100 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965676AbeBMUkg (ORCPT ); Tue, 13 Feb 2018 15:40:36 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 72F0618224D78; Tue, 13 Feb 2018 20:40:35 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: brake09_3f134fbf6b006 X-Filterd-Recvd-Size: 2653 Received: from XPS-9350 (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Tue, 13 Feb 2018 20:40:33 +0000 (UTC) Message-ID: <1518554431.22190.56.camel@perches.com> Subject: Re: [PATCH 1/2] dma/ppc4xx: Delete an error message for a failed memory allocation in two functions From: Joe Perches To: SF Markus Elfring , dmaengine@vger.kernel.org, Dan Williams , Greg Kroah-Hartman , Rob Herring , Vinod Koul Cc: LKML , kernel-janitors@vger.kernel.org Date: Tue, 13 Feb 2018 12:40:31 -0800 In-Reply-To: References: <4d9b3ca7-e1bd-42f9-5933-550146812f1e@users.sourceforge.net> X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 2018-02-13 at 21:25 +0100, SF Markus Elfring wrote: > Omit an extra message for a memory allocation failure in these functions. [] > diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c [] > @@ -4183,7 +4183,6 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) > INIT_LIST_HEAD(&ref->node); > list_add_tail(&ref->node, &ppc440spe_adma_chan_list); > } else { > - dev_err(&ofdev->dev, "failed to allocate channel reference!\n"); > ret = -ENOMEM; > goto err_ref_alloc; > } Stop being mindless and think about the change you are making. Reverse the test and unindent the block above. --- drivers/dma/ppc4xx/adma.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index 4cf0d4d0cecf..1fc1a2f03aa4 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c @@ -4178,16 +4178,15 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) } ref = kmalloc(sizeof(*ref), GFP_KERNEL); - if (ref) { - ref->chan = &chan->common; - INIT_LIST_HEAD(&ref->node); - list_add_tail(&ref->node, &ppc440spe_adma_chan_list); - } else { - dev_err(&ofdev->dev, "failed to allocate channel reference!\n"); + if (!ref) { ret = -ENOMEM; goto err_ref_alloc; } + ref->chan = &chan->common; + INIT_LIST_HEAD(&ref->node); + list_add_tail(&ref->node, &ppc440spe_adma_chan_list); + ret = ppc440spe_adma_setup_irqs(adev, chan, &initcode); if (ret) goto err_irq;