Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759946Ab3HODTp (ORCPT ); Wed, 14 Aug 2013 23:19:45 -0400 Received: from mail.active-venture.com ([67.228.131.205]:63599 "EHLO mail.active-venture.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758425Ab3HODTo (ORCPT ); Wed, 14 Aug 2013 23:19:44 -0400 X-Originating-IP: 108.223.40.66 Message-ID: <520C48D0.40509@roeck-us.net> Date: Wed, 14 Aug 2013 20:19:44 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Julia Lawall CC: Ben Dooks , kernel-janitors@vger.kernel.org, Kukjin Kim , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 20/29] watchdog: s3c2410_wdt: simplify use of devm_ioremap_resource References: <1376471493-22215-1-git-send-email-Julia.Lawall@lip6.fr> <1376471493-22215-21-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1376471493-22215-21-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 38 On 08/14/2013 02:11 AM, Julia Lawall wrote: > From: Julia Lawall > > Remove unneeded error handling on the result of a call to > platform_get_resource when the value is passed to devm_ioremap_resource. > > Move the call to platform_get_resource adjacent to the call to > devm_ioremap_resource to make the connection between them more clear. > > A simplified version of the semantic patch that makes this change is as > follows: (http://coccinelle.lip6.fr/) > > // > @@ > expression pdev,res,n,e,e1; > expression ret != 0; > identifier l; > @@ > > - res = platform_get_resource(pdev, IORESOURCE_MEM, n); > ... when != res > - if (res == NULL) { ... \(goto l;\|return ret;\) } > ... when != res > + res = platform_get_resource(pdev, IORESOURCE_MEM, n); > e = devm_ioremap_resource(e1, res); > // > > Signed-off-by: Julia Lawall > Reviewed-by: Guenter Roeck -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/