lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <041F9CBB-17E9-4D6F-B981-BC861E1048CB@toblux.com>
Date: Mon, 2 Sep 2024 16:26:16 +0200
From: Thorsten Blum <thorsten.blum@...lux.com>
To: almaz.alexandrovich@...agon-software.com
Cc: ntfs3@...ts.linux.dev,
 linux-kernel@...r.kernel.org,
 dan.carpenter@...aro.org
Subject: Re: [PATCH v2] fs/ntfs3: Use swap() to improve code

On 26. Aug 2024, at 12:39, Thorsten Blum <thorsten.blum@...lux.com> wrote:
> 
> 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@...lux.com>
> ---
> Changes in v2:
> - Address kernel test robot feedback and assign match_offset as before
> - Link to v1: https://lore.kernel.org/linux-kernel/20240731135403.80805-2-thorsten.blum@toblux.com/
> ---
> fs/ntfs3/lib/lzx_decompress.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ntfs3/lib/lzx_decompress.c b/fs/ntfs3/lib/lzx_decompress.c
> index 6b16f07073c1..4d5701024f83 100644
> --- a/fs/ntfs3/lib/lzx_decompress.c
> +++ b/fs/ntfs3/lib/lzx_decompress.c
> @@ -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  */
> 
> -- 
> 2.46.0
> 

Hi Konstantin,

I just noticed that v1 of this patch is already in next (commit 
7495ce846bbe4f38d7ea5e023e44ad864b6348ad), but v2 fixes a possible bug 
reported by kernel test robot (match_offset is still used later).

Could you take another look at it and apply v2 if possible?

Thanks,
Thorsten

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ