* [RESEND] gpu: ipu-v3: use swap()
@ 2021-07-22 16:59 Salah Triki
2021-07-23 9:58 ` Nicolas Ferre
0 siblings, 1 reply; 2+ messages in thread
From: Salah Triki @ 2021-07-22 16:59 UTC (permalink / raw)
To: herbert, davem, nicolas.ferre, alexandre.belloni,
ludovic.desroches, gregkh
Cc: linux-crypto, linux-arm-kernel, linux-kernel
Use swap() instead of implementing it in order to make code more clean.
Signed-off-by: Salah Triki <salah.triki@gmail.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND] gpu: ipu-v3: use swap()
2021-07-22 16:59 [RESEND] gpu: ipu-v3: use swap() Salah Triki
@ 2021-07-23 9:58 ` Nicolas Ferre
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Ferre @ 2021-07-23 9:58 UTC (permalink / raw)
To: Salah Triki, herbert, davem, alexandre.belloni,
ludovic.desroches, gregkh, Tudor Ambarus
Cc: linux-crypto, linux-arm-kernel, linux-kernel
Wrong $subject then...
On 22/07/2021 at 18:59, Salah Triki wrote:
> Use swap() instead of implementing it in order to make code more clean.
>
> Signed-off-by: Salah Triki <salah.triki@gmail.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
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-23 9:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 16:59 [RESEND] gpu: ipu-v3: use swap() Salah Triki
2021-07-23 9:58 ` Nicolas Ferre
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).