linux-mips
[Top] [All Lists]

Re: [PATCH 6/6] MIPS: ath79: simplify platform_get_resource_byname/devm_

To: Julia Lawall <Julia.Lawall@lip6.fr>
Subject: Re: [PATCH 6/6] MIPS: ath79: simplify platform_get_resource_byname/devm_ioremap_resource
From: John Crispin <john@phrozen.org>
Date: Sat, 31 Aug 2013 10:09:37 +0200
Cc: Gabor Juhos <juhosg@openwrt.org>, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <52164F54.2070209@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1376902316-18520-1-git-send-email-Julia.Lawall@lip6.fr> <1376902316-18520-7-git-send-email-Julia.Lawall@lip6.fr> <52164F54.2070209@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12
On 22/08/13 19:50, Gabor Juhos wrote:
2013.08.19. 10:51 keltezéssel, Julia Lawall írta:
From: Julia Lawall<Julia.Lawall@lip6.fr>

Remove unneeded error handling on the result of a call to
platform_get_resource_byname when the value is passed to devm_ioremap_resource.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

//<smpl>
@@
expression pdev,res,e,e1;
expression ret != 0;
identifier l;
@@

   res = platform_get_resource_byname(...);
- if (res == NULL) { ... \(goto l;\|return ret;\) }
   e = devm_ioremap_resource(e1, res);
//</smpl>

Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr>

Acked-by: Gabor Juhos<juhosg@openwrt.org>

Thanks!

-Gabor

Hi,

should this patch go upstream via the lmo tree ?

        John

<Prev in Thread] Current Thread [Next in Thread>