summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_ral.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2005-05-13 19:00:11 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2005-05-13 19:00:11 +0000
commitac8112a615bf00cbda21b8489a72ce6b1aa35c47 (patch)
treef43e2391a403d0f8609c93816a751c192a3e2b14 /sys/dev/usb/if_ral.c
parent99fb3a0f1e2d93f19c1c42c805fc69c9cd3fd175 (diff)
simplify test conditions. ((v & f1) || (v & f2)) <=> (v & (f1 | f2)) in
these particular cases. avoid extra calls to letoh32().
Diffstat (limited to 'sys/dev/usb/if_ral.c')
-rw-r--r--sys/dev/usb/if_ral.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index 5e37b2c1918..262a76d2f4b 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.30 2005/05/13 18:42:50 damien Exp $ */
+/* $OpenBSD: if_ral.c,v 1.31 2005/05/13 19:00:10 damien Exp $ */
/*-
* Copyright (c) 2005
@@ -854,8 +854,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
/* rx descriptor is located at the end */
desc = (struct ural_rx_desc *)(data->buf + len - RAL_RX_DESC_SIZE);
- if ((letoh32(desc->flags) & RAL_RX_PHY_ERROR) ||
- (letoh32(desc->flags) & RAL_RX_CRC_ERROR)) {
+ if (letoh32(desc->flags) & (RAL_RX_PHY_ERROR | RAL_RX_CRC_ERROR)) {
/*
* This should not happen since we did not request to receive
* those frames when we filled RAL_TXRX_CSR2.
@@ -1187,10 +1186,9 @@ ural_tx_mgt(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
*(uint16_t *)wh->i_dur = htole16(dur);
/* tell hardware to add timestamp for probe responses */
- if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
- IEEE80211_FC0_TYPE_MGT &&
- (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) ==
- IEEE80211_FC0_SUBTYPE_PROBE_RESP)
+ if ((wh->i_fc[0] &
+ (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) ==
+ (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP))
flags |= RAL_TX_TIMESTAMP;
}