diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-09-07 21:09:42 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-26 19:10:47 -0500 |
commit | 1daf417029ddc10b7854430c1e1118df791d0eaf (patch) | |
tree | 55ea0dd2a70ae093283d43f4ed11af9de5a37c0e | |
parent | 710b208dc2687fdb3370110d54a67fb2288835eb (diff) |
sfc: Merge efx_mcdi_mac_check_fault() and efx_mcdi_get_mac_faults()
The latter is only called by the former, which is a very short
wrapper. Further, gcc 4.5 may currently wrongly warn that the
'faults' variable may be used uninitialised.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi_mac.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi_mac.c b/drivers/net/ethernet/sfc/mcdi_mac.c index 4907062b24a2..559d79861faf 100644 --- a/drivers/net/ethernet/sfc/mcdi_mac.c +++ b/drivers/net/ethernet/sfc/mcdi_mac.c | |||
@@ -51,7 +51,7 @@ static int efx_mcdi_set_mac(struct efx_nic *efx) | |||
51 | NULL, 0, NULL); | 51 | NULL, 0, NULL); |
52 | } | 52 | } |
53 | 53 | ||
54 | static int efx_mcdi_get_mac_faults(struct efx_nic *efx, u32 *faults) | 54 | bool efx_mcdi_mac_check_fault(struct efx_nic *efx) |
55 | { | 55 | { |
56 | u8 outbuf[MC_CMD_GET_LINK_OUT_LEN]; | 56 | u8 outbuf[MC_CMD_GET_LINK_OUT_LEN]; |
57 | size_t outlength; | 57 | size_t outlength; |
@@ -61,16 +61,13 @@ static int efx_mcdi_get_mac_faults(struct efx_nic *efx, u32 *faults) | |||
61 | 61 | ||
62 | rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, | 62 | rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, |
63 | outbuf, sizeof(outbuf), &outlength); | 63 | outbuf, sizeof(outbuf), &outlength); |
64 | if (rc) | 64 | if (rc) { |
65 | goto fail; | 65 | netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", |
66 | 66 | __func__, rc); | |
67 | *faults = MCDI_DWORD(outbuf, GET_LINK_OUT_MAC_FAULT); | 67 | return true; |
68 | return 0; | 68 | } |
69 | 69 | ||
70 | fail: | 70 | return MCDI_DWORD(outbuf, GET_LINK_OUT_MAC_FAULT) != 0; |
71 | netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", | ||
72 | __func__, rc); | ||
73 | return rc; | ||
74 | } | 71 | } |
75 | 72 | ||
76 | int efx_mcdi_mac_stats(struct efx_nic *efx, dma_addr_t dma_addr, | 73 | int efx_mcdi_mac_stats(struct efx_nic *efx, dma_addr_t dma_addr, |
@@ -127,11 +124,3 @@ int efx_mcdi_mac_reconfigure(struct efx_nic *efx) | |||
127 | 124 | ||
128 | return 0; | 125 | return 0; |
129 | } | 126 | } |
130 | |||
131 | |||
132 | bool efx_mcdi_mac_check_fault(struct efx_nic *efx) | ||
133 | { | ||
134 | u32 faults; | ||
135 | int rc = efx_mcdi_get_mac_faults(efx, &faults); | ||
136 | return (rc != 0) || (faults != 0); | ||
137 | } | ||