summaryrefslogtreecommitdiff
path: root/mm/zswap.c
diff options
context:
space:
mode:
authorYosry Ahmed <yosryahmed@google.com>2024-03-12 02:52:10 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-04-26 06:55:48 +0300
commitfea68a75651cfc3458318416a1a2b45161cd22c2 (patch)
tree847d023599504a8b407982a3905adcf382458919 /mm/zswap.c
parentc2af060d1c18beaec56351cf9c9bcbbc5af341a3 (diff)
downloadlinux-fea68a75651cfc3458318416a1a2b45161cd22c2.tar.xz
mm: zswap: remove unnecessary check in zswap_find_zpool()
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. Link: https://lkml.kernel.org/r/20240311235210.2937484-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed <yosryahmed@google.com> Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev> Reviewed-by: Nhat Pham <nphamcs@gmail.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Yosry Ahmed <yosryahmed@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/zswap.c')
-rw-r--r--mm/zswap.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mm/zswap.c b/mm/zswap.c
index 8721980a2274..e435dc7c043b 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -871,12 +871,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))];
}
/*