Skip to content

Commit

Permalink
ice: Remove string printing for ice_status
Browse files Browse the repository at this point in the history
Remove the ice_stat_str() function which prints the string
representation of the ice_status error code. With upcoming changes
moving away from ice_status, there will be no need for this function.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
  • Loading branch information
Tony Nguyen committed Dec 14, 2021
1 parent 247dd97 commit 5f87ec4
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 236 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/ice/ice.h
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,6 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
int ice_plug_aux_dev(struct ice_pf *pf);
void ice_unplug_aux_dev(struct ice_pf *pf);
int ice_init_rdma(struct ice_pf *pf);
const char *ice_stat_str(enum ice_status stat_err);
const char *ice_aq_str(enum ice_aq_err aq_err);
bool ice_is_wol_supported(struct ice_hw *hw);
int
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/intel/ice/ice_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring,
ring->q_handle, 1, qg_buf, buf_len,
NULL);
if (status) {
dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %s\n",
ice_stat_str(status));
dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n",
status);
return -ENODEV;
}

Expand Down Expand Up @@ -962,8 +962,8 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
} else if (status == ICE_ERR_DOES_NOT_EXIST) {
dev_dbg(ice_pf_to_dev(vsi->back), "LAN Tx queues do not exist, nothing to disable\n");
} else if (status) {
dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %s\n",
ice_stat_str(status));
dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %d\n",
status);
return -ENODEV;
}

Expand Down
20 changes: 10 additions & 10 deletions drivers/net/ethernet/intel/ice/ice_devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ static void ice_info_pba(struct ice_pf *pf, struct ice_info_ctx *ctx)
status = ice_read_pba_string(hw, (u8 *)ctx->buf, sizeof(ctx->buf));
if (status)
/* We failed to locate the PBA, so just skip this entry */
dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string, status %s\n",
ice_stat_str(status));
dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string, status %d\n",
status);
}

static void ice_info_fw_mgmt(struct ice_pf *pf, struct ice_info_ctx *ctx)
Expand Down Expand Up @@ -268,8 +268,8 @@ static int ice_devlink_info_get(struct devlink *devlink,
/* discover capabilities first */
status = ice_discover_dev_caps(hw, &ctx->dev_caps);
if (status) {
dev_dbg(dev, "Failed to discover device capabilities, status %s aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status));
dev_dbg(dev, "Failed to discover device capabilities, status %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities");
err = -EIO;
goto out_free_ctx;
Expand All @@ -278,8 +278,8 @@ static int ice_devlink_info_get(struct devlink *devlink,
if (ctx->dev_caps.common_cap.nvm_update_pending_orom) {
status = ice_get_inactive_orom_ver(hw, &ctx->pending_orom);
if (status) {
dev_dbg(dev, "Unable to read inactive Option ROM version data, status %s aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status));
dev_dbg(dev, "Unable to read inactive Option ROM version data, status %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status));

/* disable display of pending Option ROM */
ctx->dev_caps.common_cap.nvm_update_pending_orom = false;
Expand All @@ -289,8 +289,8 @@ static int ice_devlink_info_get(struct devlink *devlink,
if (ctx->dev_caps.common_cap.nvm_update_pending_nvm) {
status = ice_get_inactive_nvm_ver(hw, &ctx->pending_nvm);
if (status) {
dev_dbg(dev, "Unable to read inactive NVM version data, status %s aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status));
dev_dbg(dev, "Unable to read inactive NVM version data, status %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status));

/* disable display of pending Option ROM */
ctx->dev_caps.common_cap.nvm_update_pending_nvm = false;
Expand All @@ -300,8 +300,8 @@ static int ice_devlink_info_get(struct devlink *devlink,
if (ctx->dev_caps.common_cap.nvm_update_pending_netlist) {
status = ice_get_inactive_netlist_ver(hw, &ctx->pending_netlist);
if (status) {
dev_dbg(dev, "Unable to read inactive Netlist version data, status %s aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status));
dev_dbg(dev, "Unable to read inactive Netlist version data, status %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status));

/* disable display of pending Option ROM */
ctx->dev_caps.common_cap.nvm_update_pending_netlist = false;
Expand Down
28 changes: 14 additions & 14 deletions drivers/net/ethernet/intel/ice/ice_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,

status = ice_acquire_nvm(hw, ICE_RES_READ);
if (status) {
dev_err(dev, "ice_acquire_nvm failed, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "ice_acquire_nvm failed, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto out;
Expand All @@ -297,8 +297,8 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
status = ice_read_flat_nvm(hw, eeprom->offset, &eeprom->len, buf,
false);
if (status) {
dev_err(dev, "ice_read_flat_nvm failed, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "ice_read_flat_nvm failed, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto release;
Expand Down Expand Up @@ -348,8 +348,8 @@ static u64 ice_link_test(struct net_device *netdev)
netdev_info(netdev, "link test\n");
status = ice_get_link_status(np->vsi->port_info, &link_up);
if (status) {
netdev_err(netdev, "link query error, status = %s\n",
ice_stat_str(status));
netdev_err(netdev, "link query error, status = %d\n",
status);
return 1;
}

Expand Down Expand Up @@ -2550,8 +2550,8 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)

status = ice_add_rss_cfg(&pf->hw, vsi->idx, hashed_flds, hdrs);
if (status) {
dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %s\n",
vsi->vsi_num, ice_stat_str(status));
dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %d\n",
vsi->vsi_num, status);
return -EINVAL;
}

Expand Down Expand Up @@ -3076,18 +3076,18 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
status = ice_set_fc(pi, &aq_failures, link_up);

if (aq_failures & ICE_SET_FC_AQ_FAIL_GET) {
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %s aq_err %s\n",
ice_stat_str(status),
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
err = -EAGAIN;
} else if (aq_failures & ICE_SET_FC_AQ_FAIL_SET) {
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %s aq_err %s\n",
ice_stat_str(status),
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
err = -EAGAIN;
} else if (aq_failures & ICE_SET_FC_AQ_FAIL_UPDATE) {
netdev_info(netdev, "Set fc failed on the get_link_info call with err %s aq_err %s\n",
ice_stat_str(status),
netdev_info(netdev, "Set fc failed on the get_link_info call with err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
err = -EAGAIN;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/intel/ice/ice_flex_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2242,8 +2242,8 @@ int ice_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,

status = ice_create_tunnel(&pf->hw, index, tnl_type, ntohs(ti->port));
if (status) {
netdev_err(netdev, "Error adding UDP tunnel - %s\n",
ice_stat_str(status));
netdev_err(netdev, "Error adding UDP tunnel - %d\n",
status);
return -EIO;
}

Expand All @@ -2265,8 +2265,8 @@ int ice_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table,
status = ice_destroy_tunnel(&pf->hw, ti->hw_priv, tnl_type,
ntohs(ti->port));
if (status) {
netdev_err(netdev, "Error removing UDP tunnel - %s\n",
ice_stat_str(status));
netdev_err(netdev, "Error removing UDP tunnel - %d\n",
status);
return -EIO;
}

Expand Down
28 changes: 14 additions & 14 deletions drivers/net/ethernet/intel/ice/ice_fw_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ ice_send_package_data(struct pldmfw *context, const u8 *data, u16 length)
kfree(package_data);

if (status) {
dev_err(dev, "Failed to send record package data to firmware, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "Failed to send record package data to firmware, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to record package data to firmware");
return -EIO;
Expand Down Expand Up @@ -240,8 +240,8 @@ ice_send_component_table(struct pldmfw *context, struct pldmfw_component *compon
kfree(comp_tbl);

if (status) {
dev_err(dev, "Failed to transfer component table to firmware, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "Failed to transfer component table to firmware, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to transfer component table to firmware");
return -EIO;
Expand Down Expand Up @@ -289,8 +289,8 @@ ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
status = ice_aq_update_nvm(hw, module, offset, block_size, block,
last_cmd, 0, NULL);
if (status) {
dev_err(dev, "Failed to flash module 0x%02x with block of size %u at offset %u, err %s aq_err %s\n",
module, block_size, offset, ice_stat_str(status),
dev_err(dev, "Failed to flash module 0x%02x with block of size %u at offset %u, err %d aq_err %s\n",
module, block_size, offset, status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to program flash module");
return -EIO;
Expand Down Expand Up @@ -458,8 +458,8 @@ ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,

status = ice_aq_erase_nvm(hw, module, NULL);
if (status) {
dev_err(dev, "Failed to erase %s (module 0x%02x), err %s aq_err %s\n",
component, module, ice_stat_str(status),
dev_err(dev, "Failed to erase %s (module 0x%02x), err %d aq_err %s\n",
component, module, status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to erase flash module");
err = -EIO;
Expand Down Expand Up @@ -532,8 +532,8 @@ static int ice_switch_flash_banks(struct ice_pf *pf, u8 activate_flags,

status = ice_nvm_write_activate(hw, activate_flags);
if (status) {
dev_err(dev, "Failed to switch active flash banks, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "Failed to switch active flash banks, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to switch active flash banks");
return -EIO;
Expand Down Expand Up @@ -694,8 +694,8 @@ int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw,

status = ice_acquire_nvm(hw, ICE_RES_WRITE);
if (status) {
dev_err(dev, "Failed to acquire device flash lock, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "Failed to acquire device flash lock, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock");
return -EIO;
Expand Down Expand Up @@ -800,8 +800,8 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component,

status = ice_acquire_nvm(hw, ICE_RES_WRITE);
if (status) {
dev_err(dev, "Failed to acquire device flash lock, err %s aq_err %s\n",
ice_stat_str(status),
dev_err(dev, "Failed to acquire device flash lock, err %d aq_err %s\n",
status,
ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock");
return -EIO;
Expand Down
Loading

0 comments on commit 5f87ec4

Please sign in to comment.