diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-09-01 12:46:50 +0100 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-03 09:53:45 -0400 |
commit | dc8cfa55da8c21e0b3290c29677a9d05c0a3e595 (patch) | |
tree | a4c8bedad12a15d1e7c9fcfc99f873280ca644b4 /drivers/net/sfc/selftest.c | |
parent | cc12dac2e512c2b6185ed91899e09e9910630315 (diff) | |
download | op-kernel-dev-dc8cfa55da8c21e0b3290c29677a9d05c0a3e595.zip op-kernel-dev-dc8cfa55da8c21e0b3290c29677a9d05c0a3e595.tar.gz |
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/selftest.c')
-rw-r--r-- | drivers/net/sfc/selftest.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index 53fa4ed..ff7b84c 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c @@ -60,12 +60,12 @@ static const char *payload_msg = * @payload: Payload used in tests */ struct efx_selftest_state { - int flush; + bool flush; int packet_count; struct sk_buff **skbs; /* Checksums are being offloaded */ - int offload_csum; + bool offload_csum; atomic_t rx_good; atomic_t rx_bad; @@ -537,7 +537,7 @@ efx_test_loopback(struct efx_tx_queue *tx_queue, state->packet_count, GFP_KERNEL); if (!state->skbs) return -ENOMEM; - state->flush = 0; + state->flush = false; EFX_LOG(efx, "TX queue %d testing %s loopback with %d " "packets\n", tx_queue->queue, LOOPBACK_MODE(efx), @@ -580,7 +580,8 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct ethtool_cmd ecmd, ecmd_loopback; struct efx_tx_queue *tx_queue; enum efx_loopback_mode old_mode, mode; - int count, rc, link_up; + bool link_up; + int count, rc; rc = efx_ethtool_get_settings(efx->net_dev, &ecmd); if (rc) { @@ -611,7 +612,7 @@ static int efx_test_loopbacks(struct efx_nic *efx, continue; /* Move the port into the specified loopback mode. */ - state->flush = 1; + state->flush = true; efx->loopback_mode = mode; efx_reconfigure_port(efx); @@ -664,7 +665,7 @@ static int efx_test_loopbacks(struct efx_nic *efx, out: /* Take out of loopback and restore PHY settings */ - state->flush = 1; + state->flush = true; efx->loopback_mode = old_mode; efx_ethtool_set_settings(efx->net_dev, &ecmd); @@ -716,7 +717,7 @@ int efx_offline_test(struct efx_nic *efx, * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ BUG_ON(efx->loopback_selftest); - state->flush = 1; + state->flush = true; efx->loopback_selftest = state; rc = efx_test_loopbacks(efx, tests, loopback_modes); |