Skip to contentSkip to conversation

iavf: Fix incorrect use of assigning iavf_status to int

PATCH New Mateusz Palczewski 1 participant 1 message Jan 26, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iavf: Fix incorrect use of assigning iavf_status to int

Currently there are functions in iavf_virtchnl.c for polling specific virtchnl receive events. These are all assigning iavf_status values to int values. Fix this and explicitly assign int values if iavf_status is not IAVF_SUCCESS.

Also, refactor a small amount of duplicated code that can be reused by all of the previously mentioned functions.

Finally, fix some spacing errors for variable assignment and get rid of all the goto statements in the refactored functions for clarity.

---
v2: Submit this with additional patch introducing iavf_status_to_errno function

---
 drivers/net/ethernet/intel/iavf/iavf_main.c   |   2 +-
 .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 160 ++++++++----------
 2 files changed, 69 insertions(+), 93 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
index 4fd2a47..a6d7259 100644
@@ -1551,7 +1551,7 @@ static int iavf_config_rss_aq(struct iavf_adapter *adapter)
 	}
 
 	status = iavf_aq_set_rss_lut(hw, adapter->vsi.id, false,
-				  adapter->rss_lut, adapter->rss_lut_size);
+				     adapter->rss_lut, adapter->rss_lut_size);
 	if (status) {
 		dev_err(&adapter->pdev->dev, "Cannot set RSS lut, err %s aq_err %s\n",
 			iavf_stat_str(hw, status),
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +68 -92

210 lines not on this page · raw message

Signature · 1 line
2.27.0