Received: by 10.223.185.116 with SMTP id b49csp4096293wrg; Tue, 13 Feb 2018 12:42:03 -0800 (PST) X-Google-Smtp-Source: AH8x226GMjd7L3ZiXrohXdvw/AgA5quVDZcBmm5z8V0yGEstpEGlAPTrnCIDLepP3v4SbhkboWN7 X-Received: by 10.98.196.204 with SMTP id h73mr2439829pfk.143.1518554523857; Tue, 13 Feb 2018 12:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518554523; cv=none; d=google.com; s=arc-20160816; b=z6+51BrkxpkFPVu/MEK2rffnS/s0S9lbstHSeIZIexz4epaHiZD6BAzUizuLjvIdKa iOT5Ep5tPvFWXw9nV/B70wn9pEDOE+cwYKKcppAwbKmPivDijb0u5xeQVFnZPq1LW73W CTgHvggR+6dEnbrs4oiA+JQ0q5hCKeyyu9WXgsGgm6plMVT+Az8UDoGGm+EdIMGPw9TZ x3rtj2zDbMV0fLRaeA/vjv1DHO8ZepLNAEKxEH6fyyPQGYjEdrLRqTteCW1JdVuQjJRw pTh3EaLTs/AOvvAd62DlP9VSf6PuNmiqMQwKrn+L/Oq3qFb26h9HdFCKuo8znvln8T86 JUlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=UKFwL3yswIFuzL6qgVjBqhp5HyH6SccUonYSozO47VU=; b=tBMMYRMpWRdmV7zoC9glka1qhZV6MEEr3pX0BAHS1abRzy+OavkdFBDixtEAVX9YCe Ere6pzWLGhH0uAKYZEXYDeAxfDJYajzpMd+YEAy9K3VYa29tDiNmRqoa2HiNcbzGjmBu vTPDFtDPJ9Ta2pHF262XrtO20YGPfLdEZQ8qW9c0qaQEC/Z92fkL8iy/F3aRZqxFmigI Btv7HUmvcn183dcZZYcJ36uMtnBf7R9eEVdVVBr8dpPu7I/KD1bZDwu3w9X/Prm53R4J pI4mYCdqizjzbFmcv8FK4fbus9ijmuyZRJMtQUk6/adCgLuBo4bLgd4lTp5SMnputS/S +wBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si123203pfb.335.2018.02.13.12.41.20; Tue, 13 Feb 2018 12:42:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965771AbeBMUki (ORCPT + 99 others); Tue, 13 Feb 2018 15:40:38 -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-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2899:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3873:4321:5007:9040:9167:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12294:12296:12438:12555:12740:12760:12895:13069:13095:13255:13311:13357:13439:14659:14721:21080:21212:21433:21611:21627:30054:30070:30091,0,RBL:47.151.150.235:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:20,LUA_SUMMARY:none 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> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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;