[PATCH v2 4/8] mm/zswap: use folio_swap_entry() in zswap_store_page()

David Hildenbrand (Arm) david at kernel.org
Wed Sep 9 07:00:53 PDT 2026


On 9/8/26 17:16, Tal Zussman wrote:
> zswap_store_page() open-codes the swap entry computation from
> folio->swap and the page index. Use folio_swap_entry() instead.
> 
> No functional change.
> 
> Signed-off-by: Tal Zussman <tz2294 at columbia.edu>
> ---
>  mm/zswap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 5d0d8bd72193..c27e22d067e3 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -1398,8 +1398,7 @@ static bool zswap_store_page(struct folio *folio, long index,
>  			     struct obj_cgroup *objcg,
>  			     struct zswap_pool *pool)
>  {
> -	swp_entry_t page_swpentry = swp_entry(swp_type(folio->swap),
> -					      swp_offset(folio->swap) + index);
> +	swp_entry_t page_swpentry = folio_swap_entry(folio, index);
>  	struct zswap_entry *entry, *old;
>  
>  	/* allocate entry */
> 

Acked-by: David Hildenbrand (Arm) <david at kernel.org>

-- 
Cheers,

David



More information about the linux-arm-kernel mailing list