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/mdio_10g.h | |
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/mdio_10g.h')
-rw-r--r-- | drivers/net/sfc/mdio_10g.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/sfc/mdio_10g.h b/drivers/net/sfc/mdio_10g.h index 3bb6b55010d4..19c42eaf7fb4 100644 --- a/drivers/net/sfc/mdio_10g.h +++ b/drivers/net/sfc/mdio_10g.h | |||
@@ -199,16 +199,17 @@ static inline u32 mdio_clause45_read_id(struct efx_nic *efx, int mmd) | |||
199 | return (id_hi << 16) | (id_low); | 199 | return (id_hi << 16) | (id_low); |
200 | } | 200 | } |
201 | 201 | ||
202 | static inline int mdio_clause45_phyxgxs_lane_sync(struct efx_nic *efx) | 202 | static inline bool mdio_clause45_phyxgxs_lane_sync(struct efx_nic *efx) |
203 | { | 203 | { |
204 | int i, sync, lane_status; | 204 | int i, lane_status; |
205 | bool sync; | ||
205 | 206 | ||
206 | for (i = 0; i < 2; ++i) | 207 | for (i = 0; i < 2; ++i) |
207 | lane_status = mdio_clause45_read(efx, efx->mii.phy_id, | 208 | lane_status = mdio_clause45_read(efx, efx->mii.phy_id, |
208 | MDIO_MMD_PHYXS, | 209 | MDIO_MMD_PHYXS, |
209 | MDIO_PHYXS_LANE_STATE); | 210 | MDIO_PHYXS_LANE_STATE); |
210 | 211 | ||
211 | sync = (lane_status & (1 << MDIO_PHYXS_LANE_ALIGNED_LBN)) != 0; | 212 | sync = !!(lane_status & (1 << MDIO_PHYXS_LANE_ALIGNED_LBN)); |
212 | if (!sync) | 213 | if (!sync) |
213 | EFX_LOG(efx, "XGXS lane status: %x\n", lane_status); | 214 | EFX_LOG(efx, "XGXS lane status: %x\n", lane_status); |
214 | return sync; | 215 | return sync; |
@@ -230,8 +231,8 @@ int mdio_clause45_check_mmds(struct efx_nic *efx, | |||
230 | unsigned int mmd_mask, unsigned int fatal_mask); | 231 | unsigned int mmd_mask, unsigned int fatal_mask); |
231 | 232 | ||
232 | /* Check the link status of specified mmds in bit mask */ | 233 | /* Check the link status of specified mmds in bit mask */ |
233 | extern int mdio_clause45_links_ok(struct efx_nic *efx, | 234 | extern bool mdio_clause45_links_ok(struct efx_nic *efx, |
234 | unsigned int mmd_mask); | 235 | unsigned int mmd_mask); |
235 | 236 | ||
236 | /* Generic transmit disable support though PMAPMD */ | 237 | /* Generic transmit disable support though PMAPMD */ |
237 | extern void mdio_clause45_transmit_disable(struct efx_nic *efx); | 238 | extern void mdio_clause45_transmit_disable(struct efx_nic *efx); |