[PATCH] sparc: fix warning comparing pointer to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix the following coccicheck warning:

./arch/sparc/prom/tree_64.c:335:15-16: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
Signed-off-by: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>
---
 arch/sparc/prom/tree_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 989e799..85b5101 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -332,7 +332,7 @@ int prom_node_has_property(phandle node, const char *prop)
 
 	if (size == 0)
 		return 0;
-	if ((pname == 0) || (value == 0))
+	if (!pname || !value)
 		return 0;
 	
 #ifdef CONFIG_SUN_LDOMS
-- 
1.8.3.1




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux