Skip to content

Commit

Permalink
qed: Fix static checker warning
Browse files Browse the repository at this point in the history
	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: c56a8be ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rahul Verma authored and David S. Miller committed Oct 23, 2018
1 parent 5ef7915 commit 68203a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/qlogic/qed/qed_mcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand Down

0 comments on commit 68203a6

Please sign in to comment.