From fe0d117cabd471d1a6fde560a92ed3a75c06227e Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 3 Jan 2022 03:06:49 +0000 Subject: [PATCH] Don't use != 0 to check whether a pointer is non-NULL. --- sys/arch/arm/cortex/ampintc.c | 4 ++-- sys/arch/armv7/broadcom/bcm2836_intr.c | 4 ++-- sys/arch/armv7/omap/intc.c | 4 ++-- sys/arch/armv7/sunxi/sxiintc.c | 4 ++-- sys/arch/riscv64/dev/plic.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/arch/arm/cortex/ampintc.c b/sys/arch/arm/cortex/ampintc.c index d1b4a9795ab..9689599948a 100644 --- a/sys/arch/arm/cortex/ampintc.c +++ b/sys/arch/arm/cortex/ampintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ampintc.c,v 1.29 2021/03/25 04:12:00 jsg Exp $ */ +/* $OpenBSD: ampintc.c,v 1.30 2022/01/03 03:06:49 jsg Exp $ */ /* * Copyright (c) 2007,2009,2011 Dale Rahn * @@ -668,7 +668,7 @@ ampintc_irq_handler(void *frame) KERNEL_LOCK(); #endif - if (ih->ih_arg != 0) + if (ih->ih_arg) arg = ih->ih_arg; else arg = frame; diff --git a/sys/arch/armv7/broadcom/bcm2836_intr.c b/sys/arch/armv7/broadcom/bcm2836_intr.c index c2d3ea8e733..799985b0d1c 100644 --- a/sys/arch/armv7/broadcom/bcm2836_intr.c +++ b/sys/arch/armv7/broadcom/bcm2836_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2836_intr.c,v 1.7 2021/10/24 17:52:27 mpi Exp $ */ +/* $OpenBSD: bcm2836_intr.c,v 1.8 2022/01/03 03:06:49 jsg Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * Copyright (c) 2015 Patrick Wildt @@ -455,7 +455,7 @@ bcm_intc_call_handler(int irq, void *frame) pri = sc->sc_bcm_intc_handler[irq].is_irq; s = bcm_intc_splraise(pri); TAILQ_FOREACH(ih, &sc->sc_bcm_intc_handler[irq].is_list, ih_list) { - if (ih->ih_arg != 0) + if (ih->ih_arg) arg = ih->ih_arg; else arg = frame; diff --git a/sys/arch/armv7/omap/intc.c b/sys/arch/armv7/omap/intc.c index 892a7d1b297..67de5ba0bce 100644 --- a/sys/arch/armv7/omap/intc.c +++ b/sys/arch/armv7/omap/intc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intc.c,v 1.11 2021/10/24 17:52:27 mpi Exp $ */ +/* $OpenBSD: intc.c,v 1.12 2022/01/03 03:06:50 jsg Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * @@ -337,7 +337,7 @@ intc_irq_handler(void *frame) pri = intc_handler[irq].iq_irq; s = intc_splraise(pri); TAILQ_FOREACH(ih, &intc_handler[irq].iq_list, ih_list) { - if (ih->ih_arg != 0) + if (ih->ih_arg) arg = ih->ih_arg; else arg = frame; diff --git a/sys/arch/armv7/sunxi/sxiintc.c b/sys/arch/armv7/sunxi/sxiintc.c index b9759def203..9764a635d27 100644 --- a/sys/arch/armv7/sunxi/sxiintc.c +++ b/sys/arch/armv7/sunxi/sxiintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxiintc.c,v 1.10 2021/10/24 17:52:28 mpi Exp $ */ +/* $OpenBSD: sxiintc.c,v 1.11 2022/01/03 03:06:50 jsg Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * Copyright (c) 2013 Artturi Alm @@ -359,7 +359,7 @@ sxiintc_irq_handler(void *frame) pr | (1 << IRQ2BIT32(irq))); TAILQ_FOREACH(ih, &sxiintc_handler[irq].iq_list, ih_list) { - if (ih->ih_arg != 0) + if (ih->ih_arg) arg = ih->ih_arg; else arg = frame; diff --git a/sys/arch/riscv64/dev/plic.c b/sys/arch/riscv64/dev/plic.c index 7781ba08985..f058d66aae7 100644 --- a/sys/arch/riscv64/dev/plic.c +++ b/sys/arch/riscv64/dev/plic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: plic.c,v 1.7 2021/05/19 17:39:49 kettenis Exp $ */ +/* $OpenBSD: plic.c,v 1.8 2022/01/03 03:06:50 jsg Exp $ */ /* * Copyright (c) 2020, Mars Li @@ -381,7 +381,7 @@ plic_irq_dispatch(uint32_t irq, void *frame) KERNEL_LOCK(); #endif - if (ih->ih_arg != 0) + if (ih->ih_arg) arg = ih->ih_arg; else arg = frame; -- 2.20.1