From: Kalle Valo <kvalo@codeaurora.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org,
Mathias Nyman <mathias.nyman@intel.com>,
Jussi Kivilinna <jussi.kivilinna@iki.fi>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2 3/8] rndis_wlan: Make use of cpu_to_le16_array()
Date: Tue, 18 Aug 2020 08:36:04 +0300 [thread overview]
Message-ID: <87tux0jz23.fsf@codeaurora.org> (raw)
In-Reply-To: <20200817184659.58419-3-andriy.shevchenko@linux.intel.com> (Andy Shevchenko's message of "Mon, 17 Aug 2020 21:46:54 +0300")
+ linux-wireless
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> 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: Jussi Kivilinna <jussi.kivilinna@iki.fi>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> ---
> v2: new patch
> drivers/net/wireless/rndis_wlan.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
> index 8852a1832951..06850ee6d6dc 100644
> --- a/drivers/net/wireless/rndis_wlan.c
> +++ b/drivers/net/wireless/rndis_wlan.c
> @@ -859,9 +859,12 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param,
> int value_type, void *value)
> {
> struct ndis_config_param *infobuf;
> - int value_len, info_len, param_len, ret, i;
> + int value_len, info_len, param_len, ret;
> __le16 *unibuf;
> __le32 *dst_value;
> +#ifdef DEBUG
> + int i;
> +#endif
>
> if (value_type == 0)
> value_len = sizeof(__le32);
> @@ -901,13 +904,11 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param,
>
> /* simple string to unicode string conversion */
> unibuf = (void *)infobuf + sizeof(*infobuf);
> - for (i = 0; i < param_len / sizeof(__le16); i++)
> - unibuf[i] = cpu_to_le16(param[i]);
> + cpu_to_le16_array(unibuf, param, param_len / sizeof(__le16));
>
> if (value_type == 2) {
> unibuf = (void *)infobuf + sizeof(*infobuf) + param_len;
> - for (i = 0; i < value_len / sizeof(__le16); i++)
> - unibuf[i] = cpu_to_le16(((u8 *)value)[i]);
> + cpu_to_le16_array(unibuf, value, value_len / sizeof(__le16));
> } else {
> dst_value = (void *)infobuf + sizeof(*infobuf) + param_len;
> *dst_value = cpu_to_le32(*(u32 *)value);
I assume this goes via usb tree:
Acked-by: Kalle Valo <kvalo@codeaurora.org>
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
parent reply other threads:[~2020-08-18 5:44 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20200817184659.58419-3-andriy.shevchenko@linux.intel.com>]
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=87tux0jz23.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jussi.kivilinna@iki.fi \
--cc=linux-usb@vger.kernel.org \
--cc=linux-wireless@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).