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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we have a new helper, let's replace open coded variant by it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Cc: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>
Cc: Jesse Brandeburg <jesse.brandeburg@xxxxxxxxx>
---
v2: new patch
 drivers/net/ethernet/intel/ice/ice_nvm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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];
-- 
2.28.0




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux