diff mbox

[1/2] dma/ppc4xx: Delete an error message for a failed memory allocation in two functions

Message ID 1518554431.22190.56.camel@perches.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Joe Perches Feb. 13, 2018, 8:40 p.m. UTC
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 mbox

Patch

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;