aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/enum.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-09-01 07:46:50 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-09-03 09:53:45 -0400
commitdc8cfa55da8c21e0b3290c29677a9d05c0a3e595 (patch)
treea4c8bedad12a15d1e7c9fcfc99f873280ca644b4 /drivers/net/sfc/enum.h
parentcc12dac2e512c2b6185ed91899e09e9910630315 (diff)
sfc: Use explicit bool for boolean variables, parameters and return values
Replace (cond ? 1 : 0) with cond or !!cond as appropriate, and (cond ? 0 : 1) with !cond. Remove some redundant boolean temporaries. Rename one field that looks like a flag but isn't. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/enum.h')
-rw-r--r--drivers/net/sfc/enum.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/sfc/enum.h b/drivers/net/sfc/enum.h
index c53290d08e2b..cec15dbb88e4 100644
--- a/drivers/net/sfc/enum.h
+++ b/drivers/net/sfc/enum.h
@@ -52,12 +52,11 @@ extern const char *efx_loopback_mode_names[];
52#define LOOPBACK_MASK(_efx) \ 52#define LOOPBACK_MASK(_efx) \
53 (1 << (_efx)->loopback_mode) 53 (1 << (_efx)->loopback_mode)
54 54
55#define LOOPBACK_INTERNAL(_efx) \ 55#define LOOPBACK_INTERNAL(_efx) \
56 ((LOOPBACKS_10G_INTERNAL & LOOPBACK_MASK(_efx)) ? 1 : 0) 56 (!!(LOOPBACKS_10G_INTERNAL & LOOPBACK_MASK(_efx)))
57 57
58#define LOOPBACK_OUT_OF(_from, _to, _mask) \ 58#define LOOPBACK_OUT_OF(_from, _to, _mask) \
59 (((LOOPBACK_MASK(_from) & (_mask)) && \ 59 ((LOOPBACK_MASK(_from) & (_mask)) && !(LOOPBACK_MASK(_to) & (_mask)))
60 ((LOOPBACK_MASK(_to) & (_mask)) == 0)) ? 1 : 0)
61 60
62/*****************************************************************************/ 61/*****************************************************************************/
63 62