linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lianjie Zhang <zhanglianjie@uniontech.com>
To: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Lianjie Zhang <zhanglianjie@uniontech.com>
Subject: [PATCH] mm/slub: helper macro __ATTR_XX to make code more clear
Date: Sun,  6 Mar 2022 15:38:18 +0800	[thread overview]
Message-ID: <20220306073818.15089-1-zhanglianjie@uniontech.com> (raw)

Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>

diff --git a/mm/slub.c b/mm/slub.c
index 07cdd999c3fe..59992de7d3db 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5358,12 +5358,10 @@ struct slab_attribute {
 };

 #define SLAB_ATTR_RO(_name) \
-	static struct slab_attribute _name##_attr = \
-	__ATTR(_name, 0400, _name##_show, NULL)
+	static struct slab_attribute _name##_attr = __ATTR_RO_MODE(_name, 0400)

 #define SLAB_ATTR(_name) \
-	static struct slab_attribute _name##_attr =  \
-	__ATTR(_name, 0600, _name##_show, _name##_store)
+	static struct slab_attribute _name##_attr = __ATTR_RW_MODE(_name, 0600)

 static ssize_t slab_size_show(struct kmem_cache *s, char *buf)
 {
--
2.20.1





             reply	other threads:[~2022-03-06  7:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-06  7:38 Lianjie Zhang [this message]
2022-03-06 22:11 ` David Rientjes
2022-03-07 17:11   ` Vlastimil Babka

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=20220306073818.15089-1-zhanglianjie@uniontech.com \
    --to=zhanglianjie@uniontech.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    /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