All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>
Subject: [PATCH v2 5/8] ice: Make use of le16_to_cpu_array()
Date: Mon, 17 Aug 2020 21:46:56 +0300	[thread overview]
Message-ID: <20200817184659.58419-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200817184659.58419-1-andriy.shevchenko@linux.intel.com>

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 --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


  parent reply	other threads:[~2020-08-17 18:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 18:46 [PATCH v2 1/8] byteorder: Introduce cpu_to_le16_array() and le16_to_cpu_array() Andy Shevchenko
2020-08-17 18:46 ` [PATCH v2 2/8] media: solo6x10: Make use of cpu_to_le16_array() Andy Shevchenko
2020-08-17 22:18   ` Ismael Luceno
2020-08-17 18:46 ` [PATCH v2 3/8] rndis_wlan: " Andy Shevchenko
2020-08-17 22:02   ` kernel test robot
2020-08-17 22:02     ` kernel test robot
2020-08-18  5:36   ` Kalle Valo
2020-08-18  5:36   ` Jussi Kivilinna
2020-08-17 18:46 ` [PATCH v2 4/8] i40e: Make use of le16_to_cpu_array() Andy Shevchenko
2020-08-17 18:46 ` Andy Shevchenko [this message]
2020-08-17 18:46 ` [PATCH v2 6/8] usb: early: xhci-dbc: use readl_poll_timeout() to simplify code Andy Shevchenko
2020-08-17 18:46 ` [PATCH v2 7/8] usb: early: xhci-dbc: Make use of cpu_to_le16_array() Andy Shevchenko
2020-08-17 21:23   ` kernel test robot
2020-08-17 21:23     ` kernel test robot
2020-08-17 18:46 ` [PATCH v2 8/8] usb: early: xhci-dbc: Move asm/* headers after linux/* Andy Shevchenko
2020-08-18  8:01 ` [PATCH v2 1/8] byteorder: Introduce cpu_to_le16_array() and le16_to_cpu_array() Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200817184659.58419-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.