diff mbox series

[5/9] mm/z3fold: remove confusing local variable l reassignment

Message ID 20220219092533.12596-6-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for z3fold | expand

Commit Message

Miaohe Lin Feb. 19, 2022, 9:25 a.m. UTC
The local variable l holds the address of unbuddied[i] which won't change
after we take the pool lock. Remove it to avoid confusion.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/z3fold.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Vitaly Wool March 2, 2022, 8:24 a.m. UTC | #1
On Sat, Feb 19, 2022 at 10:26 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> The local variable l holds the address of unbuddied[i] which won't change
> after we take the pool lock. Remove it to avoid confusion.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Vitaly Wool <vitaly.wool@konsulko.com>

> ---
>  mm/z3fold.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/mm/z3fold.c b/mm/z3fold.c
> index 2f848ea45b4d..adc0b3fa4906 100644
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -876,7 +876,6 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool,
>
>                 /* Re-check under lock. */
>                 spin_lock(&pool->lock);
> -               l = &unbuddied[i];
>                 if (unlikely(zhdr != list_first_entry(READ_ONCE(l),
>                                                 struct z3fold_header, buddy)) ||
>                     !z3fold_page_trylock(zhdr)) {
> --
> 2.23.0
>
diff mbox series

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 2f848ea45b4d..adc0b3fa4906 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -876,7 +876,6 @@  static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool,
 
 		/* Re-check under lock. */
 		spin_lock(&pool->lock);
-		l = &unbuddied[i];
 		if (unlikely(zhdr != list_first_entry(READ_ONCE(l),
 						struct z3fold_header, buddy)) ||
 		    !z3fold_page_trylock(zhdr)) {