From: Chengming Zhou <chengming.zhou@linux.dev>
To: Yosry Ahmed <yosryahmed@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: zswap: remove unnecessary check in zswap_find_zpool()
Date: Tue, 12 Mar 2024 12:57:58 +0800 [thread overview]
Message-ID: <afee884d-b19c-4e03-bba4-9207673b3c96@linux.dev> (raw)
In-Reply-To: <20240311235210.2937484-1-yosryahmed@google.com>
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@google.com>
Looks good to me!
Reviewed-by: Chengming Zhou <chengming.zhou@linux.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))];
> }
>
> /*
next prev parent reply other threads:[~2024-03-12 4:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 23:52 Yosry Ahmed
2024-03-12 4:57 ` Chengming Zhou [this message]
2024-03-12 9:35 ` Nhat Pham
2024-03-12 10:22 ` Yosry Ahmed
2024-03-12 19:17 ` Johannes Weiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afee884d-b19c-4e03-bba4-9207673b3c96@linux.dev \
--to=chengming.zhou@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=yosryahmed@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox