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