[PATCH 3/3] dmaengine: dw-axi-dmac: use logical NOT for NULL check on of_channels

Khairul Anuar Romli posted 3 patches 5 days, 11 hours ago
[PATCH 3/3] dmaengine: dw-axi-dmac: use logical NOT for NULL check on of_channels
Posted by Khairul Anuar Romli 5 days, 11 hours ago
    checkpatch.pl --strict reports a CHECK warning in dw-axi-dmac.c:

      CHECK: Comparison to NULL could be written "!of_channels"

    Refactor the check for 'of_channels' to use the more idiomatic
    '!of_channels' instead of an explicit comparison to NULL.

Fixes: 06b6e88c7ecf ("dmaengine: axi-dmac: wrap entire dt parse in a function")
Signed-off-by: Khairul Anuar Romli <karom.9560@gmail.com>
---
 drivers/dma/dma-axi-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 49e59a534e22..1fb387e9338c 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -1056,7 +1056,7 @@ static int axi_dmac_parse_dt(struct device *dev, struct axi_dmac *dmac)
 
 	struct device_node *of_channels __free(device_node) = of_get_child_by_name(dev->of_node,
 										   "adi,channels");
-	if (of_channels == NULL)
+	if (!of_channels)
 		return -ENODEV;
 
 	for_each_child_of_node_scoped(of_channels, of_chan) {
-- 
2.43.0