Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message Feb 6, 2018 Rapidio

lore
Share & tools
lore
#0 lore raw

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

From: Markus Elfring <[email protected]>
Subject: 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.

---

 drivers/rapidio/devices/tsi721_dma.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/rapidio/devices/tsi721_dma.c renamed from drivers/rapidio/devices/tsi721_dma.c~rapidio-tsi721_dma-adjust-six-checks-for-null-pointers +3 -3
diff -puN drivers/rapidio/devices/tsi721_dma.c~rapidio-tsi721_dma-adjust-six-checks-for-null-pointers drivers/rapidio/devices/tsi721_dma.c
@@ -222,7 +222,7 @@ static int tsi721_bdma_ch_free(struct ts
 	struct tsi721_device *priv = to_tsi721(bdma_chan->dchan.device);
 #endif
 
-	if (bdma_chan->bd_base == NULL)
+	if (!bdma_chan->bd_base)
 		return 0;
 
 	/* Check if DMA channel still running */
@@ -346,7 +346,7 @@ tsi721_desc_fill_init(struct tsi721_tx_d
 {
 	u64 rio_addr;
 
-	if (bd_ptr == NULL)
+	if (!bd_ptr)
 		return -EINVAL;
 
 	/* Initialize DMA descriptor */
@@ -370,7 +370,7 @@ tsi721_desc_fill_init(struct tsi721_tx_d
 static int
 tsi721_desc_fill_end(struct tsi721_dma_desc *bd_ptr, u32 bcount, bool interrupt)
 {
-	if (bd_ptr == NULL)
+	if (!bd_ptr)
 		return -EINVAL;
 
 	/* Update DMA descriptor */
@@ -555,9 +555,7 @@ static void tsi721_advance_work(struct t
 	 * If there is no data transfer in progress, fetch new descriptor from
 	 * the pending queue.
 	*/