diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2011-01-03 22:34:27 +0000 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-01-04 19:16:11 -0800 |
commit | ad0a3ad33c96cbba98ba62116771fb836c551e60 (patch) | |
tree | 7d91cc40d91bf63f6bfd0023c114fcc8d549700e /drivers/dma/amba-pl08x.c | |
parent | 730404ac1c47403af67420705980c99e90bf182f (diff) |
ARM: PL08x: remove unnecessary NULL and BUG checks
The tasklet always is initialized with a non-NULL data argument. It
is not possible for it to be called with a NULL data argument (unless
something is very wrong in the tasklet code - in which case lots of
stuff will break). Therefore, as plchan can never be NULL, remove
this unnecessary BUG check.
In pl08x_tasklet(), we've already dereferenced plchan->at, so it can't
be NULL here. Remove this unnecessary BUG check.
pl08x_fill_llis_for_desc() and pl08x_free_txd() are always called with
a non-NULL txd argument - either as a consequence of the code paths or
as a result of other checks already in place. We don't need to repeat
the non-NULL check in these functions.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r-- | drivers/dma/amba-pl08x.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index d22d6280242..b721ed2e884 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -623,11 +623,6 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, struct lli *llis_va; struct lli *llis_bus; - if (!txd) { - dev_err(&pl08x->adev->dev, "%s no descriptor\n", __func__); - return 0; - } - txd->llis_va = dma_pool_alloc(pl08x->pool, GFP_NOWAIT, &txd->llis_bus); if (!txd->llis_va) { @@ -993,11 +988,6 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, static void pl08x_free_txd(struct pl08x_driver_data *pl08x, struct pl08x_txd *txd) { - if (!txd) - dev_err(&pl08x->adev->dev, - "%s no descriptor to free\n", - __func__); - /* Free the LLI */ dma_pool_free(pl08x->pool, txd->llis_va, txd->llis_bus); @@ -1633,9 +1623,6 @@ static void pl08x_tasklet(unsigned long data) struct pl08x_driver_data *pl08x = plchan->host; unsigned long flags; - if (!plchan) - BUG(); - spin_lock_irqsave(&plchan->lock, flags); if (plchan->at) { @@ -1656,14 +1643,6 @@ static void pl08x_tasklet(unsigned long data) callback(callback_param); /* - * Device callbacks should NOT clear - * the current transaction on the channel - * Linus: sometimes they should? - */ - if (!plchan->at) - BUG(); - - /* * Free the descriptor if it's not for a device * using a circular buffer */ |