summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings2008-09-01 13:46:50 +0200
committerJeff Garzik2008-09-03 15:53:45 +0200
commitdc8cfa55da8c21e0b3290c29677a9d05c0a3e595 (patch)
treea4c8bedad12a15d1e7c9fcfc99f873280ca644b4 /drivers/net/sfc/ethtool.c
parentsfc: Reduce the size of struct efx_tx_buffer (diff)
downloadkernel-qcow2-linux-dc8cfa55da8c21e0b3290c29677a9d05c0a3e595.tar.gz
kernel-qcow2-linux-dc8cfa55da8c21e0b3290c29677a9d05c0a3e595.tar.xz
kernel-qcow2-linux-dc8cfa55da8c21e0b3290c29677a9d05c0a3e595.zip
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.c8
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)
/* No way to stop the hardware doing the checks; we just
* ignore the result.
*/
- efx->rx_checksum_enabled = (enable ? 1 : 0);
+ efx->rx_checksum_enabled = !!enable;
return 0;
}
@@ -641,9 +641,9 @@ static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
{
struct efx_nic *efx = netdev_priv(net_dev);
- pause->rx_pause = (efx->flow_control & EFX_FC_RX) ? 1 : 0;
- pause->tx_pause = (efx->flow_control & EFX_FC_TX) ? 1 : 0;
- pause->autoneg = (efx->flow_control & EFX_FC_AUTO) ? 1 : 0;
+ pause->rx_pause = !!(efx->flow_control & EFX_FC_RX);
+ pause->tx_pause = !!(efx->flow_control & EFX_FC_TX);
+ pause->autoneg = !!(efx->flow_control & EFX_FC_AUTO);
}