public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: Julia Lawall <julia@diku.dk>
Cc: kyle@mcmartin.ca, deller@gmx.de, linux-parisc@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 5/12] drivers/parisc: Correct redundant test
Date: Mon, 3 Aug 2009 14:33:57 -0600	[thread overview]
Message-ID: <20090803203357.GA2386@lackof.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0907271813310.2682@ask.diku.dk>

On Mon, Jul 27, 2009 at 06:13:48PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> pa_pdc_cell has already been tested.  It seems that this test should be on the
> recently returned value io_pdc_cell.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://www.emn.fr/x-info/coccinelle/)
> 
> // <smpl>
> @r exists@
> local idexpression x;
> expression E;
> @@
> 
> if (x == NULL || ...) { ... when forall
>    return ...; }
> ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
> (
> *x == NULL
> |
> *x != NULL
> )
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Good catch!

Reviewed-by: Grant Grundler <grundler@parisc-linux.org>

thanks,
grant

> ---
>  drivers/parisc/lba_pci.c            |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
> index ede6146..3aeb327 100644
> --- a/drivers/parisc/lba_pci.c
> +++ b/drivers/parisc/lba_pci.c
> @@ -992,7 +992,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
>  		return;
>  
>  	io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
> -	if (!pa_pdc_cell) {
> +	if (!io_pdc_cell) {
>  		kfree(pa_pdc_cell);
>  		return;
>  	}
> --
> To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-08-03 20:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 16:13 [PATCH 5/12] drivers/parisc: Correct redundant test Julia Lawall
2009-08-03 20:33 ` Grant Grundler [this message]
2009-08-04  2:27   ` Kyle McMartin

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=20090803203357.GA2386@lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=deller@gmx.de \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kyle@mcmartin.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@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