diff options
author | Salah Triki <salah.triki@gmail.com> | 2021-07-22 18:08:27 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-07-30 10:58:37 +0800 |
commit | 089015d36127f2f620c7a1dca28449f676654850 (patch) | |
tree | c1f4626ab9f3d042dd38e5829fee941ec061ec51 /drivers/crypto | |
parent | 0469dede0eeeefe12a9a2fd76078f4a266513457 (diff) | |
download | linux-089015d36127f2f620c7a1dca28449f676654850.tar.bz2 |
crypto: atmel-aes - use swap()
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/atmel-aes.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index d0f387674d32..9391ccc03382 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); |