From: Salah Triki Date: Thu, 22 Jul 2021 17:08:27 +0000 (+0100) Subject: crypto: atmel-aes - use swap() X-Git-Tag: v5.15~479^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=089015d36127f2f620c7a1dca28449f676654850;p=platform%2Fkernel%2Flinux-starfive.git crypto: atmel-aes - use swap() Use swap() instead of implementing it in order to make code more clean. Signed-off-by: Salah Triki Reviewed-by: Tudor Ambarus Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index d0f3876..9391ccc 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -1859,12 +1859,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);