Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 6/11] drivers/dma: Correct NULL test

0 views
Skip to first unread message

Julia Lawall

unread,
Feb 6, 2010, 3:50:02 AM2/6/10
to
From: Julia Lawall <ju...@diku.dk>

cohd_fin has already been verified not to be NULL, so the argument to
BUG_ON cannot be true.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression *x;
expression e;
identifier l;
@@

if (x == NULL || ...) {
... when forall
return ...; }
... when != goto l;
when != x = e
when != &x
*x == NULL
// </smpl>

Signed-off-by: Julia Lawall <ju...@diku.dk>

---
drivers/dma/coh901318.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index b5f2ee0..64a9372 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -613,8 +613,6 @@ static void dma_tasklet(unsigned long data)
cohd_fin->pending_irqs--;
cohc->completed = cohd_fin->desc.cookie;

- BUG_ON(cohc->nbr_active_done && cohd_fin == NULL);
-
if (cohc->nbr_active_done == 0)
return;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Dan Williams

unread,
Feb 8, 2010, 4:10:03 PM2/8/10
to
[ adding Linus in case this BUG_ON had a different intent, or can be deleted ]

Linus Walleij

unread,
Feb 9, 2010, 5:10:01 PM2/9/10
to
[Dan/Julia]

> On Sat, Feb 6, 2010 at 1:43 AM, Julia Lawall <ju...@diku.dk> wrote:
> > From: Julia Lawall <ju...@diku.dk>
> >
> > cohd_fin has already been verified not to be NULL, so the
> argument to
> > BUG_ON cannot be true.

Acked-by: Linus Walleij <linus....@stericsson.com>

BTW I've got some more DMA patches for COH 901 318 and even
a client using it cooking, if you apply this I'll happily
rebase as soon as I can see it in -next.

Linus Walleij

0 new messages