Netdev List
 help / color / mirror / Atom feed
From: Rahul Verma <rahul.verma@cavium.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <Ariel.Elior@cavium.com>,
	<Dept-EngEverestLinuxL2@cavium.com>,
	Rahul Verma <Rahul.Verma@cavium.com>
Subject: [PATCH net 1/1] qed: Fix static checker warning
Date: Tue, 23 Oct 2018 08:04:24 -0700	[thread overview]
Message-ID: <20181023150424.6046-1-rahul.verma@cavium.com> (raw)

From: Rahul Verma <Rahul.Verma@cavium.com>

	Static Checker Warnings:
	drivers/net/ethernet/qlogic/qed/qed_main.c:1510 qed_fill_link_capability()
	error: uninitialized symbol 'tcvr_state'.
	drivers/net/ethernet/qlogic/qed/qed_mcp.c:1951 qed_mcp_trans_speed_mask()
	error: uninitialized symbol 'transceiver_state'.
	drivers/net/ethernet/qlogic/qed/qed_mcp.c:1951 qed_mcp_trans_speed_mask()
	error: uninitialized symbol 'transceiver_type'.

	Symbols tcvr_state, transceiver_state and transceiver_type
	are initialized with respective default state.

Fixes: c56a8be7e7aa (qed: Add supported link and advertise link to display in ethtool.)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rahul Verma <Rahul.Verma@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_mcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
index 386ee54..f40f654 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
@@ -1900,6 +1900,9 @@ int qed_mcp_get_transceiver_data(struct qed_hwfn *p_hwfn,
 {
 	u32 transceiver_info;
 
+	*p_transceiver_type = ETH_TRANSCEIVER_TYPE_NONE;
+	*p_transceiver_state = ETH_TRANSCEIVER_STATE_UPDATING;
+
 	if (IS_VF(p_hwfn->cdev))
 		return -EINVAL;
 
@@ -1908,9 +1911,6 @@ int qed_mcp_get_transceiver_data(struct qed_hwfn *p_hwfn,
 		return -EBUSY;
 	}
 
-	*p_transceiver_type = ETH_TRANSCEIVER_TYPE_NONE;
-	*p_transceiver_state = ETH_TRANSCEIVER_STATE_UPDATING;
-
 	transceiver_info = qed_rd(p_hwfn, p_ptt,
 				  p_hwfn->mcp_info->port_addr +
 				  offsetof(struct public_port,
-- 
1.8.3.1

             reply	other threads:[~2018-10-23 23:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 15:04 Rahul Verma [this message]
2018-10-23 18:05 ` [PATCH net 1/1] qed: Fix static checker warning 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=20181023150424.6046-1-rahul.verma@cavium.com \
    --to=rahul.verma@cavium.com \
    --cc=Ariel.Elior@cavium.com \
    --cc=Dept-EngEverestLinuxL2@cavium.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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