]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ice: remove unused struct member
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Wed, 31 Mar 2021 21:17:03 +0000 (14:17 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 15 Apr 2021 00:00:06 +0000 (17:00 -0700)
The only time you can ever have a rq_last_status is if
a firmware event was somehow reporting a status on the receive
queue, which are generally firmware initiated events or
mailbox messages from a VF.  Mostly this struct member was unused.

Fix this problem by still printing the value of the field in a debug
print, but don't store the value forever in a struct, potentially
creating opportunities for callers to use the wrong struct member.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_controlq.c
drivers/net/ethernet/intel/ice/ice_controlq.h

index 0f207a42ea77ef84aba6332cb77fd043cb0531c9..87b33bdd496042c58bca4a58dc0f20971de2d49d 100644 (file)
@@ -1097,6 +1097,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
                  struct ice_rq_event_info *e, u16 *pending)
 {
        u16 ntc = cq->rq.next_to_clean;
+       enum ice_aq_err rq_last_status;
        enum ice_status ret_code = 0;
        struct ice_aq_desc *desc;
        struct ice_dma_mem *bi;
@@ -1130,13 +1131,12 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
        desc = ICE_CTL_Q_DESC(cq->rq, ntc);
        desc_idx = ntc;
 
-       cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
+       rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
        flags = le16_to_cpu(desc->flags);
        if (flags & ICE_AQ_FLAG_ERR) {
                ret_code = ICE_ERR_AQ_ERROR;
                ice_debug(hw, ICE_DBG_AQ_MSG, "Control Receive Queue Event 0x%04X received with error 0x%X\n",
-                         le16_to_cpu(desc->opcode),
-                         cq->rq_last_status);
+                         le16_to_cpu(desc->opcode), rq_last_status);
        }
        memcpy(&e->desc, desc, sizeof(e->desc));
        datalen = le16_to_cpu(desc->datalen);
index 77c2307d4fb8054726fbda8ed03ea3b62b7ae594..fe75871e48cae101ebb2340ca2cdd26ca53f5242 100644 (file)
@@ -83,7 +83,6 @@ struct ice_rq_event_info {
 /* Control Queue information */
 struct ice_ctl_q_info {
        enum ice_ctl_q qtype;
-       enum ice_aq_err rq_last_status; /* last status on receive queue */
        struct ice_ctl_q_ring rq;       /* receive queue */
        struct ice_ctl_q_ring sq;       /* send queue */
        u32 sq_cmd_timeout;             /* send queue cmd write back timeout */