From: Joe Perches <joe@perches.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
dmaengine@vger.kernel.org,
Dan Williams <dan.j.williams@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>, Vinod Koul <vinod.koul@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2] dma/ppc4xx: Delete an error message for a failed memory allocation in two functions
Date: Tue, 13 Feb 2018 12:40:31 -0800 [thread overview]
Message-ID: <1518554431.22190.56.camel@perches.com> (raw)
In-Reply-To: <ce6646e3-dfb5-2496-2a3a-d41de4802de6@users.sourceforge.net>
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;
next prev parent reply other threads:[~2018-02-13 20:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 20:23 [PATCH 0/2] DMA-PPC4xx: Adjustments for three function implementations SF Markus Elfring
2018-02-13 20:25 ` [PATCH 1/2] dma/ppc4xx: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2018-02-13 20:40 ` Joe Perches [this message]
2018-02-13 20:26 ` [PATCH 2/2] dma/ppc4xx: Improve a size determination in ppc440spe_adma_alloc_chan_resources() SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1518554431.22190.56.camel@perches.com \
--to=joe@perches.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=elfring@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox