Commit eab216e9 authored by Markus Elfring's avatar Markus Elfring Committed by Linus Torvalds

drivers/rapidio/devices/tsi721_dma.c: adjust six checks for null pointers

checkpatch pointed out the following:

  Comparison to NULL could be written !...

Thus fix the affected source code places.

Link: http://lkml.kernel.org/r/c3e79a1a-891e-cb62-990f-bd99839311b9@users.sourceforge.netSigned-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: default avatarAlexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6d94a03c
...@@ -222,7 +222,7 @@ static int tsi721_bdma_ch_free(struct tsi721_bdma_chan *bdma_chan) ...@@ -222,7 +222,7 @@ static int tsi721_bdma_ch_free(struct tsi721_bdma_chan *bdma_chan)
struct tsi721_device *priv = to_tsi721(bdma_chan->dchan.device); struct tsi721_device *priv = to_tsi721(bdma_chan->dchan.device);
#endif #endif
if (bdma_chan->bd_base == NULL) if (!bdma_chan->bd_base)
return 0; return 0;
/* Check if DMA channel still running */ /* Check if DMA channel still running */
...@@ -346,7 +346,7 @@ tsi721_desc_fill_init(struct tsi721_tx_desc *desc, ...@@ -346,7 +346,7 @@ tsi721_desc_fill_init(struct tsi721_tx_desc *desc,
{ {
u64 rio_addr; u64 rio_addr;
if (bd_ptr == NULL) if (!bd_ptr)
return -EINVAL; return -EINVAL;
/* Initialize DMA descriptor */ /* Initialize DMA descriptor */
...@@ -370,7 +370,7 @@ tsi721_desc_fill_init(struct tsi721_tx_desc *desc, ...@@ -370,7 +370,7 @@ tsi721_desc_fill_init(struct tsi721_tx_desc *desc,
static int static int
tsi721_desc_fill_end(struct tsi721_dma_desc *bd_ptr, u32 bcount, bool interrupt) tsi721_desc_fill_end(struct tsi721_dma_desc *bd_ptr, u32 bcount, bool interrupt)
{ {
if (bd_ptr == NULL) if (!bd_ptr)
return -EINVAL; return -EINVAL;
/* Update DMA descriptor */ /* Update DMA descriptor */
...@@ -555,9 +555,7 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan, ...@@ -555,9 +555,7 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan,
* If there is no data transfer in progress, fetch new descriptor from * If there is no data transfer in progress, fetch new descriptor from
* the pending queue. * the pending queue.
*/ */
if (!desc && !bdma_chan->active_tx && !list_empty(&bdma_chan->queue)) {
if (desc == NULL && bdma_chan->active_tx == NULL &&
!list_empty(&bdma_chan->queue)) {
desc = list_first_entry(&bdma_chan->queue, desc = list_first_entry(&bdma_chan->queue,
struct tsi721_tx_desc, desc_node); struct tsi721_tx_desc, desc_node);
list_del_init((&desc->desc_node)); list_del_init((&desc->desc_node));
...@@ -796,7 +794,7 @@ static void tsi721_free_chan_resources(struct dma_chan *dchan) ...@@ -796,7 +794,7 @@ static void tsi721_free_chan_resources(struct dma_chan *dchan)
tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id); tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id);
if (bdma_chan->bd_base == NULL) if (!bdma_chan->bd_base)
return; return;
tsi721_bdma_interrupt_enable(bdma_chan, 0); tsi721_bdma_interrupt_enable(bdma_chan, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment