Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.net
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Markus Elfring and committed by
Linus Torvalds
eab216e9 6d94a03c

+5 -7
+5 -7
drivers/rapidio/devices/tsi721_dma.c
··· 222 222 struct tsi721_device *priv = to_tsi721(bdma_chan->dchan.device); 223 223 #endif 224 224 225 - if (bdma_chan->bd_base == NULL) 225 + if (!bdma_chan->bd_base) 226 226 return 0; 227 227 228 228 /* Check if DMA channel still running */ ··· 346 346 { 347 347 u64 rio_addr; 348 348 349 - if (bd_ptr == NULL) 349 + if (!bd_ptr) 350 350 return -EINVAL; 351 351 352 352 /* Initialize DMA descriptor */ ··· 370 370 static int 371 371 tsi721_desc_fill_end(struct tsi721_dma_desc *bd_ptr, u32 bcount, bool interrupt) 372 372 { 373 - if (bd_ptr == NULL) 373 + if (!bd_ptr) 374 374 return -EINVAL; 375 375 376 376 /* Update DMA descriptor */ ··· 555 555 * If there is no data transfer in progress, fetch new descriptor from 556 556 * the pending queue. 557 557 */ 558 - 559 - if (desc == NULL && bdma_chan->active_tx == NULL && 560 - !list_empty(&bdma_chan->queue)) { 558 + if (!desc && !bdma_chan->active_tx && !list_empty(&bdma_chan->queue)) { 561 559 desc = list_first_entry(&bdma_chan->queue, 562 560 struct tsi721_tx_desc, desc_node); 563 561 list_del_init((&desc->desc_node)); ··· 794 796 795 797 tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id); 796 798 797 - if (bdma_chan->bd_base == NULL) 799 + if (!bdma_chan->bd_base) 798 800 return; 799 801 800 802 tsi721_bdma_interrupt_enable(bdma_chan, 0);