aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fatm/if_fatm.c
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-04-21 19:57:40 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-04-21 19:57:40 +0000
commitd9c9c81c083a76a65c6cacf8fcbc0511e2ffa489 (patch)
treecd4dfa8859a5f57124d315ff395b524d7587e1ea /sys/dev/fatm/if_fatm.c
parent5977d3e898348ce714243a4189cee906151aa522 (diff)
downloadsrc-d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489.tar.gz
src-d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489.zip
sys: use our roundup2/rounddown2() macros when param.h is available.
rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted.
Notes
Notes: svn path=/head/; revision=298433
Diffstat (limited to 'sys/dev/fatm/if_fatm.c')
-rw-r--r--sys/dev/fatm/if_fatm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c
index ec85d31ae570..9a42b932955a 100644
--- a/sys/dev/fatm/if_fatm.c
+++ b/sys/dev/fatm/if_fatm.c
@@ -116,8 +116,8 @@ static const struct utopia_methods fatm_utopia_methods = {
};
#define VC_OK(SC, VPI, VCI) \
- (((VPI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vpi_bits) - 1)) == 0 && \
- (VCI) != 0 && ((VCI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vci_bits) - 1)) == 0)
+ (rounddown2(VPI, 1 << IFP2IFATM((SC)->ifp)->mib.vpi_bits) == 0 && \
+ (VCI) != 0 && rounddown2(VCI, 1 << IFP2IFATM((SC)->ifp)->mib.vci_bits) == 0)
static int fatm_load_vc(struct fatm_softc *sc, struct card_vcc *vc);