diff mbox series

[v2,5/8] ice: Make use of le16_to_cpu_array()

Message ID 20200817184659.58419-5-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: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
v2: new patch
 drivers/net/ethernet/intel/ice/ice_nvm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_nvm.c b/drivers/net/ethernet/intel/ice/ice_nvm.c
index 5903a36763de..3c376cb49e61 100644
--- a/drivers/net/ethernet/intel/ice/ice_nvm.c
+++ b/drivers/net/ethernet/intel/ice/ice_nvm.c
@@ -448,8 +448,8 @@  static enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw)
 	enum ice_status ret;
 	u32 id_blk_start;
 	__le16 raw_data;
-	u16 data, i;
 	u16 *buff;
+	u16 data;
 
 	ret = ice_acquire_nvm(hw, ICE_RES_READ);
 	if (ret)
@@ -494,8 +494,7 @@  static enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw)
 	if (ret)
 		goto exit_error;
 
-	for (i = 0; i < ICE_AQC_NVM_NETLIST_ID_BLK_LEN; i++)
-		buff[i] = le16_to_cpu(((__force __le16 *)buff)[i]);
+	le16_to_cpu_array(buff, buff, ICE_AQC_NVM_NETLIST_ID_BLK_LEN);
 
 	ver->major = (buff[ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_HIGH] << 16) |
 		buff[ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_LOW];