fs/ntfs3: Use swap() to improve code

Use the swap() macro to simplify the code and improve its readability.

Fixes the following Coccinelle/coccicheck warning reported by
swap.cocci:

  WARNING opportunity for swap()

Compile-tested only.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Thorsten Blum 2024-07-31 15:54:04 +02:00 committed by Konstantin Komarov
parent 8400291e28
commit a4f2b9a787
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6

View File

@ -512,8 +512,7 @@ static int lzx_decompress_block(const struct lzx_decompressor *d,
* the same code. (For R0, the swap is a no-op.)
*/
match_offset = recent_offsets[offset_slot];
recent_offsets[offset_slot] = recent_offsets[0];
recent_offsets[0] = match_offset;
swap(recent_offsets[offset_slot], recent_offsets[0]);
} else {
/* Explicit offset */