From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH S58 08/13] ice: remove unused struct member
Date: Wed, 31 Mar 2021 14:17:03 -0700 [thread overview]
Message-ID: <20210331211708.55205-8-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210331211708.55205-1-anthony.l.nguyen@intel.com>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
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>
---
drivers/net/ethernet/intel/ice/ice_controlq.c | 6 +++---
drivers/net/ethernet/intel/ice/ice_controlq.h | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c
index 0f207a42ea77..87b33bdd4960 100644
--- a/drivers/net/ethernet/intel/ice/ice_controlq.c
+++ b/drivers/net/ethernet/intel/ice/ice_controlq.c
@@ -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);
diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.h b/drivers/net/ethernet/intel/ice/ice_controlq.h
index 77c2307d4fb8..fe75871e48ca 100644
--- a/drivers/net/ethernet/intel/ice/ice_controlq.h
+++ b/drivers/net/ethernet/intel/ice/ice_controlq.h
@@ -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 */
--
2.20.1
next prev parent reply other threads:[~2021-03-31 21:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 21:16 [Intel-wired-lan] [PATCH S58 01/13] ice: refactor interrupt moderation writes Tony Nguyen
2021-03-31 21:16 ` [Intel-wired-lan] [PATCH S58 02/13] ice: replace custom AIM algorithm with kernel's DIM library Tony Nguyen
2021-04-14 23:19 ` Brelinski, TonyX
2021-03-31 21:16 ` [Intel-wired-lan] [PATCH S58 03/13] ice: manage interrupts during poll exit Tony Nguyen
2021-04-12 17:27 ` Brelinski, TonyX
2021-03-31 21:16 ` [Intel-wired-lan] [PATCH S58 04/13] ice: refactor ITR data structures Tony Nguyen
2021-04-12 17:18 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 05/13] ice: Reimplement module reads used by ethtool Tony Nguyen
2021-04-08 21:31 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 06/13] ice: print name in /proc/iomem Tony Nguyen
2021-04-08 21:35 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 07/13] ice: use local for consistency Tony Nguyen
2021-04-08 21:38 ` Brelinski, TonyX
2021-03-31 21:17 ` Tony Nguyen [this message]
2021-04-08 21:41 ` [Intel-wired-lan] [PATCH S58 08/13] ice: remove unused struct member Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 09/13] ice: Set vsi->vf_id as ICE_INVAL_VFID for non VF VSI types Tony Nguyen
2021-04-08 22:24 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 10/13] ice: suppress false cppcheck issues Tony Nguyen
2021-04-08 22:26 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 11/13] ice: fix clang warning regarding deadcode.DeadStores Tony Nguyen
2021-04-08 22:30 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 12/13] ice: remove return variable Tony Nguyen
2021-04-08 22:33 ` Brelinski, TonyX
2021-03-31 21:17 ` [Intel-wired-lan] [PATCH S58 13/13] ice: reduce scope of variable Tony Nguyen
2021-04-08 22:37 ` Brelinski, TonyX
2021-04-08 19:54 ` [Intel-wired-lan] [PATCH S58 01/13] ice: refactor interrupt moderation writes Brelinski, TonyX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210331211708.55205-8-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox