@@ -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;
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(-)