linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] powerpc/maple: fix comparing pointer to 0
@ 2020-01-21  1:31 Chen Zhou
  2020-01-21  1:52 ` Joe Perches
  2020-01-29  5:17 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Chen Zhou @ 2020-01-21  1:31 UTC (permalink / raw)
  To: benh, paulus, mpe
  Cc: gregkh, nivedita, tglx, allison, linuxppc-dev, linux-kernel, chenzhou10

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@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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] powerpc/maple: fix comparing pointer to 0
  2020-01-21  1:31 [PATCH -next] powerpc/maple: fix comparing pointer to 0 Chen Zhou
@ 2020-01-21  1:52 ` Joe Perches
  2020-01-21  7:47   ` Segher Boessenkool
  2020-01-29  5:17 ` Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2020-01-21  1:52 UTC (permalink / raw)
  To: Chen Zhou, benh, paulus, mpe
  Cc: gregkh, nivedita, tglx, allison, linuxppc-dev, linux-kernel

On Tue, 2020-01-21 at 09:31 +0800, Chen Zhou wrote:
> 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(-)

diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 47f7310..d6a083c 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -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;



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] powerpc/maple: fix comparing pointer to 0
  2020-01-21  1:52 ` Joe Perches
@ 2020-01-21  7:47   ` Segher Boessenkool
  2020-01-21 11:15     ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Segher Boessenkool @ 2020-01-21  7:47 UTC (permalink / raw)
  To: Joe Perches
  Cc: Chen Zhou, benh, paulus, mpe, gregkh, linux-kernel, nivedita,
	tglx, linuxppc-dev, allison

On Mon, Jan 20, 2020 at 05:52:15PM -0800, Joe Perches wrote:
> On Tue, 2020-01-21 at 09:31 +0800, Chen Zhou wrote:
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] powerpc/maple: fix comparing pointer to 0
  2020-01-21  7:47   ` Segher Boessenkool
@ 2020-01-21 11:15     ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2020-01-21 11:15 UTC (permalink / raw)
  To: Segher Boessenkool
  Cc: Chen Zhou, benh, paulus, mpe, gregkh, linux-kernel, nivedita,
	tglx, linuxppc-dev, allison

On Tue, 2020-01-21 at 01:47 -0600, Segher Boessenkool wrote:
> On Mon, Jan 20, 2020 at 05:52:15PM -0800, Joe Perches wrote:
> > On Tue, 2020-01-21 at 09:31 +0800, Chen Zhou wrote:
> > > 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.

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>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] powerpc/maple: fix comparing pointer to 0
  2020-01-21  1:31 [PATCH -next] powerpc/maple: fix comparing pointer to 0 Chen Zhou
  2020-01-21  1:52 ` Joe Perches
@ 2020-01-29  5:17 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2020-01-29  5:17 UTC (permalink / raw)
  To: Chen Zhou, benh, paulus
  Cc: chenzhou10, gregkh, linux-kernel, nivedita, tglx, linuxppc-dev, allison

On Tue, 2020-01-21 at 01:31:53 UTC, Chen Zhou wrote:
> 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@huawei.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/1e3531982ee70adf1880715a968d9c3365f321ed

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-29  5:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21  1:31 [PATCH -next] powerpc/maple: fix comparing pointer to 0 Chen Zhou
2020-01-21  1:52 ` Joe Perches
2020-01-21  7:47   ` Segher Boessenkool
2020-01-21 11:15     ` Joe Perches
2020-01-29  5:17 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).