Skip to contentSkip to conversation

dma/direct: Use true and false for boolean values

PATCH New Gustavo A. R. Silva 1 participant 1 message Aug 8, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma/direct: Use true and false for boolean values

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

---
 arch/arm/include/asm/dma-direct.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/include/asm/dma-direct.h +4 -4
index b67e5fc..906fdcf 100644
@@ -19,18 +19,18 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 	u64 limit, mask;
 
 	if (!dev->dma_mask)
-		return 0;
+		return false;
 
 	mask = *dev->dma_mask;
 
 	limit = (mask + 1) & ~mask;
 	if (limit && size > limit)
-		return 0;
+		return false;
 
 	if ((addr | (addr + size - 1)) & ~mask)
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 #endif /* ASM_ARM_DMA_DIRECT_H */
Signature · 1 line
2.7.4