[PATCH -next] powerpc/maple: fix comparing pointer to 0
Chen Zhou
chenzhou10 at huawei.com
Tue Jan 21 12:31:53 AEDT 2020
Fixes coccicheck warning:
./arch/powerpc/platforms/maple/setup.c:232:15-16:
WARNING comparing pointer to 0
Compare pointer-typed values to NULL rather than 0.
Signed-off-by: Chen Zhou <chenzhou10 at huawei.com>
---
arch/powerpc/platforms/maple/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 47f7310..00a0780 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -229,7 +229,7 @@ static void __init maple_init_IRQ(void)
root = of_find_node_by_path("/");
naddr = of_n_addr_cells(root);
opprop = of_get_property(root, "platform-open-pic", &opplen);
- if (opprop != 0) {
+ if (opprop) {
openpic_addr = of_read_number(opprop, naddr);
has_isus = (opplen > naddr);
printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n",
--
2.7.4
More information about the Linuxppc-dev
mailing list