linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <salah.triki@gmail.com>, <herbert@gondor.apana.org.au>,
	<davem@davemloft.net>, <Nicolas.Ferre@microchip.com>,
	<alexandre.belloni@bootlin.com>,
	<Ludovic.Desroches@microchip.com>, <gregkh@linuxfoundation.org>
Cc: <linux-crypto@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [RESEND] crypto: atmel-aes: use swap()
Date: Fri, 23 Jul 2021 04:24:56 +0000	[thread overview]
Message-ID: <e0c89ce0-4f69-0a2d-0e1c-a730864b38cb@microchip.com> (raw)
In-Reply-To: <20210722170827.GA4362@pc>

On 7/22/21 8:08 PM, Salah Triki wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Use swap() instead of implementing it in order to make code more clean.
> 
> Signed-off-by: Salah Triki <salah.triki@gmail.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/crypto/atmel-aes.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
> index b1d286004295..60041022c4f5 100644
> --- a/drivers/crypto/atmel-aes.c
> +++ b/drivers/crypto/atmel-aes.c
> @@ -1819,12 +1819,8 @@ static int atmel_aes_xts_process_data(struct atmel_aes_dev *dd)
>          * the order of the ciphered tweak bytes need to be reversed before
>          * writing them into the ODATARx registers.
>          */
> -       for (i = 0; i < AES_BLOCK_SIZE/2; ++i) {
> -               u8 tmp = tweak_bytes[AES_BLOCK_SIZE - 1 - i];
> -
> -               tweak_bytes[AES_BLOCK_SIZE - 1 - i] = tweak_bytes[i];
> -               tweak_bytes[i] = tmp;
> -       }
> +       for (i = 0; i < AES_BLOCK_SIZE/2; ++i)
> +               swap(tweak_bytes[i], tweak_bytes[AES_BLOCK_SIZE - 1 - i]);
> 
>         /* Process the data. */
>         atmel_aes_write_ctrl(dd, use_dma, NULL);
> --
> 2.25.1
> 


  reply	other threads:[~2021-07-23  4:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 17:08 [RESEND] crypto: atmel-aes: use swap() Salah Triki
2021-07-23  4:24 ` Tudor.Ambarus [this message]
2021-07-23  4:31 ` Tudor.Ambarus
2021-07-30  3:11 ` Herbert Xu

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=e0c89ce0-4f69-0a2d-0e1c-a730864b38cb@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=salah.triki@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).