Skip to contentSkip to conversation

powerpc/maple: fix comparing pointer to 0

PATCH Applied Chen Zhou 4 participants 5 messages Jan 21, 2020 – Jan 29, 2020 PowerPC

lore
Share & tools
lore

Chen Zhou

author
#0 lore raw

PATCH 1/1 powerpc/maple: fix comparing pointer to 0

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.

---
 arch/powerpc/platforms/maple/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/maple/setup.c +1 -1
index 47f7310..00a0780 100644
@@ -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",
Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · Chen Zhou

Fixes coccicheck warning:
./arch/powerpc/platforms/maple/setup.c:232:15-16:
WARNING comparing pointer to 0

Does anyone have or use these powerpc maple boards anymore?

Maybe the whole codebase should just be deleted instead.

If not, setup.c has an unused DBG macro that could be removed too.

---
 arch/powerpc/platforms/maple/setup.c | 6 ------
 1 file changed, 6 deletions(-)
arch/powerpc/platforms/maple/setup.c +0 -6
index 47f7310..d6a083c 100644
@@ -57,12 +57,6 @@
 
 #include "maple.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 static unsigned long maple_find_nvram_base(void)
 {
 	struct device_node *rtcs;
#2 lore raw
Quoted 8 lines · Joe Perches
Quoted 3 lines · Chen Zhou

Fixes coccicheck warning:
./arch/powerpc/platforms/maple/setup.c:232:15-16:
WARNING comparing pointer to 0

Does anyone have or use these powerpc maple boards anymore?

Maybe the whole codebase should just be deleted instead.

This is used for *all* non-Apple 970 systems (not running virtualized), not just actual Maple.

Segher

#3 lore raw
Quoted 6 lines · Segher Boessenkool
Quoted 5 lines · Joe Perches
Quoted 3 lines · Chen Zhou

Fixes coccicheck warning:
./arch/powerpc/platforms/maple/setup.c:232:15-16:
WARNING comparing pointer to 0

Quoted 6 lines
Quoted 3 lines

Does anyone have or use these powerpc maple boards anymore?

Maybe the whole codebase should just be deleted instead.

This is used for *all* non-Apple 970 systems (not running virtualized), not just actual Maple.

OK, then likely this Kconfig description should be updated (and the http://www.970eval.com link is no longer about powerpc)

$ cat arch/powerpc/platforms/maple/Kconfig
# SPDX-License-Identifier: GPL-2.0
config PPC_MAPLE
	depends on PPC64 && PPC_BOOK3S && CPU_BIG_ENDIAN
	bool "Maple 970FX Evaluation Board"
	select FORCE_PCI
	select MPIC
	select U3_DART
	select MPIC_U3_HT_IRQS
	select GENERIC_TBSYNC
	select PPC_UDBG_16550
	select PPC_970_NAP
	select PPC_NATIVE
	select PPC_RTAS
	select MMIO_NVRAM
	select ATA_NONSTANDARD if ATA
	help
	  This option enables support for the Maple 970FX Evaluation Board.
	  For more information, refer to <http://www.970eval.com>