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: <afee884d-b19c-4e03-bba4-9207673b3c96@linux.dev>
Date: Tue, 12 Mar 2024 12:57:58 +0800
From: Chengming Zhou <chengming.zhou@...ux.dev>
To: Yosry Ahmed <yosryahmed@...gle.com>,
 Andrew Morton <akpm@...ux-foundation.org>
Cc: Johannes Weiner <hannes@...xchg.org>, Nhat Pham <nphamcs@...il.com>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: zswap: remove unnecessary check in zswap_find_zpool()

On 2024/3/12 07:52, Yosry Ahmed wrote:
> zswap_find_zpool() checks if ZSWAP_NR_ZPOOLS > 1, which is always true.
> This is a remnant from a patch version that had ZSWAP_NR_ZPOOLS as a
> config option and never made it upstream. Remove the unnecessary check.
> 
> Signed-off-by: Yosry Ahmed <yosryahmed@...gle.com>

Looks good to me!

Reviewed-by: Chengming Zhou <chengming.zhou@...ux.dev>

Thanks.

> ---
>  mm/zswap.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 9a32377520827..c6267b5e0999a 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -884,12 +884,7 @@ static void zswap_entry_cache_free(struct zswap_entry *entry)
>  
>  static struct zpool *zswap_find_zpool(struct zswap_entry *entry)
>  {
> -	int i = 0;
> -
> -	if (ZSWAP_NR_ZPOOLS > 1)
> -		i = hash_ptr(entry, ilog2(ZSWAP_NR_ZPOOLS));
> -
> -	return entry->pool->zpools[i];
> +	return entry->pool->zpools[hash_ptr(entry, ilog2(ZSWAP_NR_ZPOOLS))];
>  }
>  
>  /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ