diff mbox series

[v2,4/8] i40e: Make use of le16_to_cpu_array()

Message ID 20200817184659.58419-4-andriy.shevchenko@linux.intel.com
State New
Headers show
Series None | expand

Commit Message

Andy Shevchenko Aug. 17, 2020, 6:46 p.m. UTC
Since we have a new helper, let's replace open coded variant by it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
---
v2: new patch
 drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 7164f4ad8120..154505f352bc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -444,7 +444,6 @@  static i40e_status i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset,
 	u16 read_size;
 	bool last_cmd = false;
 	u16 words_read = 0;
-	u16 i = 0;
 
 	do {
 		/* Calculate number of bytes we should read in this step.
@@ -475,8 +474,7 @@  static i40e_status i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset,
 		offset += read_size;
 	} while (words_read < *words);
 
-	for (i = 0; i < *words; i++)
-		data[i] = le16_to_cpu(((__le16 *)data)[i]);
+	le16_to_cpu_array(data, data, *words);
 
 read_nvm_buffer_aq_exit:
 	*words = words_read;