netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@redhat.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 3/6] igb: Fix warning pin may be used uninitialized
Date: Fri,  6 Mar 2015 03:06:03 -0800	[thread overview]
Message-ID: <1425639966-6829-4-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1425639966-6829-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@redhat.com>

When building the kernel using the gcc 4.8.3 compiler included in Fedora 20
I was repeatedly seeing the warning:

 drivers/net/ethernet/intel/igb/igb_ptp.c: In function ‘igb_ptp_feature_enable_i210’:
 drivers/net/ethernet/intel/igb/igb_ptp.c:395:21: warning: ‘pin’ may be used uninitialized in this function
 [-Wmaybe-uninitialized]
   tssdp &= ~ts_sdp_en[pin];
                     ^
 drivers/net/ethernet/intel/igb/igb_ptp.c:471:6: note: ‘pin’ was declared here
   int pin;
       ^

To resolve it I am assigning the pin a value of -1 when it is instantiated.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index d20fc8e..525e5c4 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -468,7 +468,7 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
 	u32 tsauxc, tsim, tsauxc_mask, tsim_mask, trgttiml, trgttimh;
 	unsigned long flags;
 	struct timespec ts;
-	int pin;
+	int pin = -1;
 	s64 ns;
 
 	switch (rq->type) {
-- 
1.9.3

  parent reply	other threads:[~2015-03-06 11:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 11:06 [net-next 0/6][pull request] Intel Wired LAN Driver Updates 2015-03-06 Jeff Kirsher
2015-03-06 11:06 ` [net-next 1/6] e1000e: fix obscure comments Jeff Kirsher
2015-03-06 11:06 ` [net-next 2/6] e1000e: remove calls to ioremap/unmap for NVM addr Jeff Kirsher
2015-03-06 11:06 ` Jeff Kirsher [this message]
2015-03-06 11:06 ` [net-next 4/6] igb: Make arrays on stack static const to avoid reallocation Jeff Kirsher
2015-03-06 11:06 ` [net-next 5/6] e1000: call netif_carrier_off early on down Jeff Kirsher
2015-03-06 11:06 ` [net-next 6/6] e1000: add dummy allocator to fix race condition between mtu change and netpoll Jeff Kirsher
2015-03-06 20:01 ` [net-next 0/6][pull request] Intel Wired LAN Driver Updates 2015-03-06 David Miller

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=1425639966-6829-4-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).