linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slub: helper macro __ATTR_XX to make code more clear
@ 2022-03-06  7:38 Lianjie Zhang
  2022-03-06 22:11 ` David Rientjes
  0 siblings, 1 reply; 3+ messages in thread
From: Lianjie Zhang @ 2022-03-06  7:38 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton,
	Vlastimil Babka, Roman Gushchin, linux-mm, linux-kernel,
	Lianjie Zhang

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-07 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-06  7:38 [PATCH] mm/slub: helper macro __ATTR_XX to make code more clear Lianjie Zhang
2022-03-06 22:11 ` David Rientjes
2022-03-07 17:11   ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox