From 81a0a6112d132e5fb781fe7113759e291aeca971 Mon Sep 17 00:00:00 2001 From: anton Date: Tue, 28 Jun 2022 16:29:03 +0000 Subject: [PATCH] No need to pass a copy of the bcmdmac_channel structure to predicate routines. ok deraadt@ kettenis@ --- sys/dev/fdt/bcm2835_dmac.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/fdt/bcm2835_dmac.c b/sys/dev/fdt/bcm2835_dmac.c index 145810dd7af..0149839cf04 100644 --- a/sys/dev/fdt/bcm2835_dmac.c +++ b/sys/dev/fdt/bcm2835_dmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2835_dmac.c,v 1.2 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: bcm2835_dmac.c,v 1.3 2022/06/28 16:29:03 anton Exp $ */ /* * Copyright (c) 2020 Tobias Heider @@ -97,18 +97,18 @@ struct cfdriver bcmdmac_cd = { NULL, "bcmdmac", DV_DULL }; /* utilities */ enum bcmdmac_type -bcmdmac_channel_type(struct bcmdmac_channel ch) +bcmdmac_channel_type(struct bcmdmac_channel *ch) { - if (ISSET(ch.ch_debug, DMAC_DEBUG_LITE)) + if (ISSET(ch->ch_debug, DMAC_DEBUG_LITE)) return BCMDMAC_TYPE_LITE; else return BCMDMAC_TYPE_NORMAL; } int -bcmdmac_channel_used(struct bcmdmac_channel ch) +bcmdmac_channel_used(struct bcmdmac_channel *ch) { - return ch.ch_callback != NULL; + return ch->ch_callback != NULL; } void @@ -233,9 +233,9 @@ bcmdmac_alloc(enum bcmdmac_type type, int ipl, for (index = 0; index < sc->sc_nchannels; index++) { if (!ISSET(sc->sc_channelmask, (1 << index))) continue; - if (bcmdmac_channel_type(sc->sc_channels[index]) != type) + if (bcmdmac_channel_type(&sc->sc_channels[index]) != type) continue; - if (bcmdmac_channel_used(sc->sc_channels[index])) + if (bcmdmac_channel_used(&sc->sc_channels[index])) continue; ch = &sc->sc_channels[index]; -- 2.20.1