Commit 7b115dd0 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

i40e: clean up debug_read_register

There were some additional spaces and strange (double swapping) logic
in this function that I started looking at because sparse was warning.

This fixes the sparse warning and fixes up the other issues.

Change-ID: I72a91a4197cd45921602649040e6bd25e5f17c0a
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 71e6163a
...@@ -2126,7 +2126,7 @@ i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid, ...@@ -2126,7 +2126,7 @@ i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
* Read the register using the admin queue commands * Read the register using the admin queue commands
**/ **/
i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw, i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw,
u32 reg_addr, u64 *reg_val, u32 reg_addr, u64 *reg_val,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
...@@ -2137,17 +2137,15 @@ i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw, ...@@ -2137,17 +2137,15 @@ i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw,
if (reg_val == NULL) if (reg_val == NULL)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_debug_read_reg);
i40e_aqc_opc_debug_read_reg);
cmd_resp->address = cpu_to_le32(reg_addr); cmd_resp->address = cpu_to_le32(reg_addr);
status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
if (!status) { if (!status) {
*reg_val = ((u64)cmd_resp->value_high << 32) | *reg_val = ((u64)le32_to_cpu(cmd_resp->value_high) << 32) |
(u64)cmd_resp->value_low; (u64)le32_to_cpu(cmd_resp->value_low);
*reg_val = le64_to_cpu(*reg_val);
} }
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment