mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: xu.xin16@zte.com.cn, akpm@linux-foundation.org, ljs@kernel.org
Cc: ziy@nvidia.com, baolin.wang@linux.alibaba.com, baohua@kernel.org,
	lance.yang@linux.dev, usama.arif@linux.dev,
	chengming.zhou@linux.dev, qi.zheng@linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, npache@redhat.com,
	ryan.roberts@arm.com, dev.jain@arm.com, wang.yaxin@zte.com.cn
Subject: Re: [PATCH v2 2/2] mm/mm_slot.h: clean up macro parameter names in mm_slot_lookup() and mm_slot_insert()
Date: Mon, 13 Jul 2026 17:24:03 +0200	[thread overview]
Message-ID: <b542ad50-097b-4440-8e7b-6a93c8a70ed1@kernel.org> (raw)
In-Reply-To: <20260713144153556amKkr4s-dWoQu5-ziCfZe@zte.com.cn>

On 7/13/26 08:41, xu.xin16@zte.com.cn wrote:
> From: xu xin <xu.xin16@zte.com.cn>
> 

No patch description, but the other patch "mm/mm_slot.h: clean up macro
parameter names in mm_slot_lookup() and mm_slot_insert()" has some.

> Suggested-by: Lorenzo Stoakes <ljs@kernel.org>
> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
> ---
>  mm/mm_slot.h | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/mm_slot.h b/mm/mm_slot.h
> index 5de3e91d86b4..710c70166c79 100644
> --- a/mm/mm_slot.h
> +++ b/mm/mm_slot.h
> @@ -33,12 +33,17 @@ static inline void mm_slot_free(struct kmem_cache *cache, void *objp)
>  	kmem_cache_free(cache, objp);
>  }
> 
> -#define mm_slot_lookup(_hashtable, _mm) 				       \
> +/*
> + * Note: mm_slot_lookup and mm_slot_insert cannot be converted to static inline
> + * functions because hash_for_each_possible relys on the actual array argument
> + * 'hashtable' for sizeof() instead of pointers.
> + */
> +#define mm_slot_lookup(hashtable, mm)					       \
>  ({									       \
>  	struct mm_slot *tmp_slot, *mm_slot = NULL;			       \
>  									       \
> -	hash_for_each_possible(_hashtable, tmp_slot, hash, (unsigned long)_mm) \
> -		if (_mm == tmp_slot->mm) {				       \
> +	hash_for_each_possible(hashtable, tmp_slot, hash, (unsigned long)mm)   \
> +		if (mm == tmp_slot->mm) {				       \
>  			mm_slot = tmp_slot;				       \
>  			break;						       \
>  		}							       \
> @@ -46,10 +51,10 @@ static inline void mm_slot_free(struct kmem_cache *cache, void *objp)
>  	mm_slot;							       \
>  })
> 
> -#define mm_slot_insert(_hashtable, _mm, _mm_slot)			       \
> +#define mm_slot_insert(hashtable, mm, mm_slot)				       \
>  ({									       \
> -	_mm_slot->mm = _mm;						       \
> -	hash_add(_hashtable, &_mm_slot->hash, (unsigned long)_mm);	       \
> +	mm_slot->mm = mm;						       \
> +	hash_add(hashtable, &mm_slot->hash, (unsigned long)mm);		       \
>  })
> 
>  static inline void mm_slot_remove(struct mm_slot *slot)


-- 
Cheers,

David

  parent reply	other threads:[~2026-07-13 15:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  6:35 [PATCH v2 0/2] Two small patches to clean up mm/mm_slot.h xu.xin16
2026-07-13  6:37 ` [PATCH v2 1/2] mm/mm_slot.h: add a helper function mm_slot_remove xu.xin16
2026-07-13 11:48   ` Nico Pache
2026-07-13 13:51   ` Zi Yan
2026-07-13 15:19   ` Barry Song
2026-07-13 15:23   ` David Hildenbrand (Arm)
2026-07-13 16:03   ` Lorenzo Stoakes (ARM)
2026-07-14  0:16   ` SJ Park
2026-07-13  6:38 ` mm/mm_slot.h: clean up macro parameter names in mm_slot_lookup() and mm_slot_insert() xu.xin16
2026-07-13  6:41 ` [PATCH v2 2/2] " xu.xin16
2026-07-13 15:21   ` Barry Song
2026-07-14  0:32     ` xu.xin16
2026-07-13 15:24   ` David Hildenbrand (Arm) [this message]
2026-07-14  0:30     ` xu.xin16
2026-07-13 16:13   ` Lorenzo Stoakes (ARM)
2026-07-14  0:41     ` xu.xin16
2026-07-14  1:06       ` Barry Song

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=b542ad50-097b-4440-8e7b-6a93c8a70ed1@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=chengming.zhou@linux.dev \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=npache@redhat.com \
    --cc=qi.zheng@linux.dev \
    --cc=ryan.roberts@arm.com \
    --cc=usama.arif@linux.dev \
    --cc=wang.yaxin@zte.com.cn \
    --cc=xu.xin16@zte.com.cn \
    --cc=ziy@nvidia.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