mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org, cpufreq@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Julia Lawall <julia@diku.dk>
Subject: Re: [PATCH 2/6] drivers/cpufreq/pcc-cpufreq.c: fix error return code
Date: Sun, 5 Aug 2012 23:11:44 +0200	[thread overview]
Message-ID: <201208052311.44825.rjw@sisk.pl> (raw)
In-Reply-To: <1344160356-387-3-git-send-email-Julia.Lawall@lip6.fr>

On Sunday, August 05, 2012, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> Convert a 0 error return code to a negative one, as returned elsewhere in the
> function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> identifier ret;
> expression e,e1,e2,e3,e4,x;
> @@
> 
> (
> if (\(ret != 0\|ret < 0\) || ...) { ... return ...; }
> |
> ret = 0
> )
> ... when != ret = e1
> *x = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_ioremap\|devm_ioremap_nocache\)(...);
> ... when != x = e2
>     when != ret = e3
> *if (x == NULL || ...)
> {
>   ... when != ret = e4
> *  return ret;
> }
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Applied to the linux-next branch of the linux-pm.git tree.  I'm going to
push it as a fix for v3.6.

Thanks,
Rafael


> ---
>  drivers/cpufreq/pcc-cpufreq.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
> index cdc02ac..503996a 100644
> --- a/drivers/cpufreq/pcc-cpufreq.c
> +++ b/drivers/cpufreq/pcc-cpufreq.c
> @@ -454,6 +454,7 @@ static int __init pcc_cpufreq_probe(void)
>  					mem_resource->address_length);
>  	if (pcch_virt_addr == NULL) {
>  		pr_debug("probe: could not map shared mem region\n");
> +		ret = -ENOMEM;
>  		goto out_free;
>  	}
>  	pcch_hdr = pcch_virt_addr;
> 
> 
> 


  reply	other threads:[~2012-08-05 21:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05  9:52 [PATCH 0/6] " Julia Lawall
2012-08-05  9:52 ` [PATCH 1/6] drivers/edac/i7core_edac.c: " Julia Lawall
2012-08-05  9:52 ` [PATCH 2/6] drivers/cpufreq/pcc-cpufreq.c: " Julia Lawall
2012-08-05 21:11   ` Rafael J. Wysocki [this message]
2012-08-05  9:52 ` [PATCH 3/6] arch/powerpc/kvm/e500_tlb.c: " Julia Lawall
2012-10-02 11:04   ` Alexander Graf
2012-08-05  9:52 ` [PATCH 4/6] drivers/gpio/gpio-langwell.c: " Julia Lawall
2012-08-05 19:10   ` Linus Walleij
2012-08-05  9:52 ` [PATCH 5/6] drivers/char/tlclk.c: " Julia Lawall
2012-08-06  3:22   ` Gross, Mark
2012-08-05  9:52 ` [PATCH 6/6] drivers/atm/iphase.c: " Julia Lawall
2012-08-06 20:30   ` David Miller

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=201208052311.44825.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=Julia.Lawall@lip6.fr \
    --cc=cpufreq@vger.kernel.org \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®