Skip to content

Commit 34e7aef

Browse files
jco-xilinxdavem330
authored andcommitted
sfc: refactor debug-or-warnings printks
Rationalise several debug-or-warnings printks using netif_cond_dbg to make output more consistent. Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f617f27 commit 34e7aef

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4881,10 +4881,10 @@ static int efx_ef10_filter_insert_def(struct efx_nic *efx,
48814881

48824882
rc = efx_ef10_filter_insert(efx, &spec, true);
48834883
if (rc < 0) {
4884-
netif_printk(efx, drv, rc == -EPERM ? KERN_DEBUG : KERN_WARNING,
4885-
efx->net_dev,
4886-
"%scast mismatch filter insert failed rc=%d\n",
4887-
multicast ? "Multi" : "Uni", rc);
4884+
netif_cond_dbg(efx, drv, efx->net_dev,
4885+
rc == -EPERM, warn,
4886+
"%scast mismatch filter insert failed rc=%d\n",
4887+
multicast ? "Multi" : "Uni", rc);
48884888
} else if (multicast) {
48894889
EFX_WARN_ON_PARANOID(vlan->mcdef != EFX_EF10_FILTER_ID_INVALID);
48904890
vlan->mcdef = efx_ef10_filter_get_unsafe_id(efx, rc);

drivers/net/ethernet/sfc/mcdi.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,9 @@ static int _efx_mcdi_rpc(struct efx_nic *efx, unsigned int cmd,
837837
outbuf, outlen, outlen_actual,
838838
quiet, NULL, raw_rc);
839839
} else {
840-
netif_printk(efx, hw,
841-
rc == -EPERM ? KERN_DEBUG : KERN_ERR,
842-
efx->net_dev,
843-
"MC command 0x%x failed after proxy auth rc=%d\n",
844-
cmd, rc);
840+
netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err,
841+
"MC command 0x%x failed after proxy auth rc=%d\n",
842+
cmd, rc);
845843

846844
if (rc == -EINTR || rc == -EIO)
847845
efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE);
@@ -1084,10 +1082,9 @@ void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
10841082
code = MCDI_DWORD(outbuf, ERR_CODE);
10851083
if (outlen >= MC_CMD_ERR_ARG_OFST + 4)
10861084
err_arg = MCDI_DWORD(outbuf, ERR_ARG);
1087-
netif_printk(efx, hw, rc == -EPERM ? KERN_DEBUG : KERN_ERR,
1088-
efx->net_dev,
1089-
"MC command 0x%x inlen %zu failed rc=%d (raw=%d) arg=%d\n",
1090-
cmd, inlen, rc, code, err_arg);
1085+
netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err,
1086+
"MC command 0x%x inlen %zu failed rc=%d (raw=%d) arg=%d\n",
1087+
cmd, inlen, rc, code, err_arg);
10911088
}
10921089

10931090
/* Switch to polled MCDI completions. This can be called in various
@@ -2057,8 +2054,8 @@ int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out,
20572054
/* Older firmware lacks GET_WORKAROUNDS and this isn't especially
20582055
* terrifying. The call site will have to deal with it though.
20592056
*/
2060-
netif_printk(efx, hw, rc == -ENOSYS ? KERN_DEBUG : KERN_ERR,
2061-
efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
2057+
netif_cond_dbg(efx, hw, efx->net_dev, rc == -ENOSYS, err,
2058+
"%s: failed rc=%d\n", __func__, rc);
20622059
return rc;
20632060
}
20642061

0 commit comments

Comments
 (0)