Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111332
b: refs/heads/master
c: f8ea0b6
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and Jeff Garzik committed Sep 3, 2008
1 parent bb4c485 commit 6899064
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9713e6f4eb55a73c39a72fb8067fd053cdf8e95
refs/heads/master: f8ea0b6743f00180ee3260d82f383a02a4dd9a78
42 changes: 16 additions & 26 deletions trunk/drivers/net/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,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 = 0, link_up;
int count, rc, link_up;

rc = efx_ethtool_get_settings(efx->net_dev, &ecmd);
if (rc) {
EFX_ERR(efx, "could not get GMII settings\n");
Expand Down Expand Up @@ -641,8 +641,8 @@ static int efx_test_loopbacks(struct efx_nic *efx,
efx_for_each_tx_queue(tx_queue, efx) {
state->offload_csum = (tx_queue->queue ==
EFX_TX_QUEUE_OFFLOAD_CSUM);
rc |= efx_test_loopback(tx_queue,
&tests->loopback[mode]);
rc = efx_test_loopback(tx_queue,
&tests->loopback[mode]);
if (rc)
goto out;
}
Expand All @@ -668,22 +668,20 @@ static int efx_test_loopbacks(struct efx_nic *efx,
int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests)
{
struct efx_channel *channel;
int rc = 0;
int rc;

EFX_LOG(efx, "performing online self-tests\n");

rc |= efx_test_interrupts(efx, tests);
rc = efx_test_interrupts(efx, tests);
if (rc)
return rc;
efx_for_each_channel(channel, efx) {
if (channel->has_interrupt)
rc |= efx_test_eventq_irq(channel, tests);
rc = efx_test_eventq_irq(channel, tests);
else
rc |= efx_test_eventq(channel, tests);
rc = efx_test_eventq(channel, tests);
if (rc)
return rc;
}
rc |= efx_test_phy(efx, tests);

if (rc)
EFX_ERR(efx, "failed online self-tests\n");

rc = efx_test_phy(efx, tests);
return rc;
}

Expand All @@ -693,16 +691,12 @@ int efx_offline_test(struct efx_nic *efx,
struct efx_self_tests *tests, unsigned int loopback_modes)
{
struct efx_selftest_state *state;
int rc = 0;

EFX_LOG(efx, "performing offline self-tests\n");
int rc;

/* Create a selftest_state structure to hold state for the test */
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL) {
rc = -ENOMEM;
goto out;
}
if (state == NULL)
return -ENOMEM;

/* Set the port loopback_selftest member. From this point on
* all received packets will be dropped. Mark the state as
Expand All @@ -717,10 +711,6 @@ int efx_offline_test(struct efx_nic *efx,
wmb();
kfree(state);

out:
if (rc)
EFX_ERR(efx, "failed offline self-tests\n");

return rc;
}

0 comments on commit 6899064

Please sign in to comment.