From 419292d6be89842dfcc6220e2db86c24e80b6ece Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 4 May 2015 03:59:42 +0000 Subject: [PATCH] Fix some misuse of the | operator. In particular | has higher precedence than ?: ok guenther@ krw@ miod@ --- sys/arch/armv7/sunxi/sxipio.c | 4 ++-- sys/dev/cardbus/if_dc_cardbus.c | 4 ++-- sys/dev/ic/mpi.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arch/armv7/sunxi/sxipio.c b/sys/arch/armv7/sunxi/sxipio.c index b62d58f3700..d0beb4a7327 100644 --- a/sys/arch/armv7/sunxi/sxipio.c +++ b/sys/arch/armv7/sunxi/sxipio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxipio.c,v 1.5 2013/11/06 19:03:07 syl Exp $ */ +/* $OpenBSD: sxipio.c,v 1.6 2015/05/04 03:59:42 jsg Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. * Copyright (c) 2013 Artturi Alm @@ -204,7 +204,7 @@ next: sc->sc_gpio_pins[port][pin].pin_state = sxipio_getpin((port * 32) + pin); sc->sc_gpio_pins[port][pin].pin_flags = GPIO_PIN_SET | - cfg ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; + (cfg ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT); } else { /* disable control of taken over pins */ sc->sc_gpio_pins[port][pin].pin_caps = 0; diff --git a/sys/dev/cardbus/if_dc_cardbus.c b/sys/dev/cardbus/if_dc_cardbus.c index bff7195bc0a..a0b88e5d6f6 100644 --- a/sys/dev/cardbus/if_dc_cardbus.c +++ b/sys/dev/cardbus/if_dc_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dc_cardbus.c,v 1.37 2015/03/14 03:38:47 jsg Exp $ */ +/* $OpenBSD: if_dc_cardbus.c,v 1.38 2015/05/04 03:59:42 jsg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -266,7 +266,7 @@ dc_cardbus_setup(struct dc_cardbus_softc *csc) /* wakeup the card if needed */ reg = pci_conf_read(pc, csc->sc_tag, PCI_CFDA); - if (reg | (DC_CFDA_SUSPEND|DC_CFDA_STANDBY)) { + if (reg & (DC_CFDA_SUSPEND|DC_CFDA_STANDBY)) { pci_conf_write(pc, csc->sc_tag, PCI_CFDA, reg & ~(DC_CFDA_SUSPEND|DC_CFDA_STANDBY)); } diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 0350ba29cca..9796229e459 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.200 2015/03/14 03:38:47 jsg Exp $ */ +/* $OpenBSD: mpi.c,v 1.201 2015/05/04 03:59:42 jsg Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne @@ -1541,7 +1541,7 @@ mpi_load_xs(struct mpi_ccb *ccb) error = bus_dmamap_load(sc->sc_dmat, dmap, xs->data, xs->datalen, NULL, BUS_DMA_STREAMING | - (xs->flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK); + ((xs->flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK)); if (error) { printf("%s: error %d loading dmamap\n", DEVNAME(sc), error); return (1); -- 2.20.1