diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-09-01 07:46:50 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-03 09:53:45 -0400 |
commit | dc8cfa55da8c21e0b3290c29677a9d05c0a3e595 (patch) | |
tree | a4c8bedad12a15d1e7c9fcfc99f873280ca644b4 /drivers/net/sfc/ethtool.c | |
parent | cc12dac2e512c2b6185ed91899e09e9910630315 (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/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index ccd82f12456c..6142c3a394bf 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -447,7 +447,7 @@ static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable) | |||
447 | /* No way to stop the hardware doing the checks; we just | 447 | /* No way to stop the hardware doing the checks; we just |
448 | * ignore the result. | 448 | * ignore the result. |
449 | */ | 449 | */ |
450 | efx->rx_checksum_enabled = (enable ? 1 : 0); | 450 | efx->rx_checksum_enabled = !!enable; |
451 | 451 | ||
452 | return 0; | 452 | return 0; |
453 | } | 453 | } |
@@ -641,9 +641,9 @@ static void efx_ethtool_get_pauseparam(struct net_device *net_dev, | |||
641 | { | 641 | { |
642 | struct efx_nic *efx = netdev_priv(net_dev); | 642 | struct efx_nic *efx = netdev_priv(net_dev); |
643 | 643 | ||
644 | pause->rx_pause = (efx->flow_control & EFX_FC_RX) ? 1 : 0; | 644 | pause->rx_pause = !!(efx->flow_control & EFX_FC_RX); |
645 | pause->tx_pause = (efx->flow_control & EFX_FC_TX) ? 1 : 0; | 645 | pause->tx_pause = !!(efx->flow_control & EFX_FC_TX); |
646 | pause->autoneg = (efx->flow_control & EFX_FC_AUTO) ? 1 : 0; | 646 | pause->autoneg = !!(efx->flow_control & EFX_FC_AUTO); |
647 | } | 647 | } |
648 | 648 | ||
649 | 649 | ||