Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?J=CE=B5an?= Sacren <sakiwit@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next-queue 6/8] i40evf: clean up local variable initialization
Date: Sun, 11 Oct 2015 23:59:46 -0600	[thread overview]
Message-ID: <1444629588-29933-6-git-send-email-sakiwit@gmail.com> (raw)
In-Reply-To: <1444629588-29933-1-git-send-email-sakiwit@gmail.com>

From: Jean Sacren <sakiwit@gmail.com>

In i40evf_msix_aq(), the first two lines of rd32() are mainly to clear
the registers. If we initialize 'val' at this point, it will be
overwritten immediately. We shall simply discard the return value here.

When we initialize 'val', we might as well include the mask in one step.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 3b638f68b249..7d6d30c53060 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -308,11 +308,11 @@ static irqreturn_t i40evf_msix_aq(int irq, void *data)
 	u32 val;
 
 	/* handle non-queue interrupts, these reads clear the registers */
-	val = rd32(hw, I40E_VFINT_ICR01);
-	val = rd32(hw, I40E_VFINT_ICR0_ENA1);
+	rd32(hw, I40E_VFINT_ICR01);
+	rd32(hw, I40E_VFINT_ICR0_ENA1);
 
-	val = rd32(hw, I40E_VFINT_DYN_CTL01);
-	val = val | I40E_VFINT_DYN_CTL01_CLEARPBA_MASK;
+	val = rd32(hw, I40E_VFINT_DYN_CTL01) |
+	      I40E_VFINT_DYN_CTL01_CLEARPBA_MASK;
 	wr32(hw, I40E_VFINT_DYN_CTL01, val);
 
 	/* schedule work on the private workqueue */

  parent reply	other threads:[~2015-10-12  5:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  5:59 [Intel-wired-lan] [next-queue 1/8] igb: fix a typo in the configuration help menu =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12  5:59 ` [Intel-wired-lan] [next-queue 2/8] ixgbe: " =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12 15:38   ` Fujinaka, Todd
2015-10-12 17:31   ` Rustad, Mark D
2015-10-12  5:59 ` [Intel-wired-lan] [next-queue 3/8] i40evf: add missing kernel-doc argument =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12  5:59 ` [Intel-wired-lan] [next-queue 4/8] i40e: " =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12  5:59 ` [Intel-wired-lan] [next-queue 5/8] i40e: clean up the entire function exit path =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12  5:59 ` =?unknown-8bit?q?J=CE=B5an?= Sacren [this message]
2015-10-12  5:59 ` [Intel-wired-lan] [next-queue 7/8] i40e: clean up local variable initialization =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12  5:59 ` [Intel-wired-lan] [next-queue 8/8] i40e: fix unconditional execution of cpu_to_le16() =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12 15:33 ` [Intel-wired-lan] [next-queue 1/8] igb: fix a typo in the configuration help menu Hisashi T Fujinaka
2015-10-13  6:56   ` =?unknown-8bit?q?J=CE=B5an?= Sacren
2015-10-12 17:33 ` Rustad, Mark D

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=1444629588-29933-6-git-send-email-sakiwit@gmail.com \
    --to=sakiwit@gmail.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