linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: "Michał Bartoszkiewicz" <mbartoszkiewicz@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723au: remove unnecessary le32_to_cpu
Date: Wed, 02 Sep 2015 08:55:50 -0400	[thread overview]
Message-ID: <wrfj1tehvv3d.fsf@redhat.com> (raw)
In-Reply-To: <1441150500-14023-1-git-send-email-mbartoszkiewicz@gmail.com> ("Michał Bartoszkiewicz"'s message of "Wed, 2 Sep 2015 01:35:00 +0200")

Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com> writes:
> The values passed to le32_to_cpu are already in the correct byte order.
> This fixes four "cast to restricted __le32" sparse warnings.
>
> Signed-off-by: Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_security.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Sounds OK to me - the fact we never hit problems with this is a good
indicator the hw crypt functions work.

Cheers,
Jes

>
> diff --git a/drivers/staging/rtl8723au/core/rtw_security.c b/drivers/staging/rtl8723au/core/rtw_security.c
> index 3d40bab..9d1cce1 100644
> --- a/drivers/staging/rtl8723au/core/rtw_security.c
> +++ b/drivers/staging/rtl8723au/core/rtw_security.c
> @@ -245,8 +245,8 @@ void rtw_wep_decrypt23a(struct rtw_adapter *padapter,
>  	arcfour_encrypt(&mycontext, payload, payload, length);
>  
>  	/* calculate icv and compare the icv */
> -	actual_crc = le32_to_cpu(getcrc32(payload, length - 4));
> -	expected_crc = le32_to_cpu(get_unaligned_le32(&payload[length - 4]));
> +	actual_crc = getcrc32(payload, length - 4);
> +	expected_crc = get_unaligned_le32(&payload[length - 4]);
>  
>  	if (actual_crc != expected_crc) {
>  		RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
> @@ -773,8 +773,8 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter,
>  	arcfour_init(&mycontext, rc4key, 16);
>  	arcfour_encrypt(&mycontext, payload, payload, length);
>  
> -	actual_crc = le32_to_cpu(getcrc32(payload, length - 4));
> -	expected_crc = le32_to_cpu(get_unaligned_le32(&payload[length - 4]));
> +	actual_crc = getcrc32(payload, length - 4);
> +	expected_crc = get_unaligned_le32(&payload[length - 4]);
>  
>  	if (actual_crc != expected_crc) {
>  		RT_TRACE(_module_rtl871x_security_c_, _drv_err_,

      reply	other threads:[~2015-09-02 12:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 23:35 [PATCH] staging: rtl8723au: remove unnecessary le32_to_cpu Michał Bartoszkiewicz
2015-09-02 12:55 ` Jes Sorensen [this message]

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=wrfj1tehvv3d.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mbartoszkiewicz@gmail.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).