Commit 43a630e3 authored by Michal Schmidt's avatar Michal Schmidt Committed by Tony Nguyen

ice: remove unused buffer copy code in ice_sq_send_cmd_retry()

The 'buf_cpy'-related code in ice_sq_send_cmd_retry() looks broken.
'buf' is nowhere copied into 'buf_cpy'.

The reason this does not cause problems is that all commands for which
'is_cmd_for_retry' is true go with a NULL buf.

Let's remove 'buf_cpy'. Add a WARN_ON in case the assumption no longer
holds in the future.
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Reviewed-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent f86d6f9c
...@@ -1619,7 +1619,6 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq, ...@@ -1619,7 +1619,6 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq,
{ {
struct ice_aq_desc desc_cpy; struct ice_aq_desc desc_cpy;
bool is_cmd_for_retry; bool is_cmd_for_retry;
u8 *buf_cpy = NULL;
u8 idx = 0; u8 idx = 0;
u16 opcode; u16 opcode;
int status; int status;
...@@ -1629,11 +1628,8 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq, ...@@ -1629,11 +1628,8 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq,
memset(&desc_cpy, 0, sizeof(desc_cpy)); memset(&desc_cpy, 0, sizeof(desc_cpy));
if (is_cmd_for_retry) { if (is_cmd_for_retry) {
if (buf) { /* All retryable cmds are direct, without buf. */
buf_cpy = kzalloc(buf_size, GFP_KERNEL); WARN_ON(buf);
if (!buf_cpy)
return -ENOMEM;
}
memcpy(&desc_cpy, desc, sizeof(desc_cpy)); memcpy(&desc_cpy, desc, sizeof(desc_cpy));
} }
...@@ -1645,17 +1641,12 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq, ...@@ -1645,17 +1641,12 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq,
hw->adminq.sq_last_status != ICE_AQ_RC_EBUSY) hw->adminq.sq_last_status != ICE_AQ_RC_EBUSY)
break; break;
if (buf_cpy)
memcpy(buf, buf_cpy, buf_size);
memcpy(desc, &desc_cpy, sizeof(desc_cpy)); memcpy(desc, &desc_cpy, sizeof(desc_cpy));
mdelay(ICE_SQ_SEND_DELAY_TIME_MS); mdelay(ICE_SQ_SEND_DELAY_TIME_MS);
} while (++idx < ICE_SQ_SEND_MAX_EXECUTE); } while (++idx < ICE_SQ_SEND_MAX_EXECUTE);
kfree(buf_cpy);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment