[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220306073818.15089-1-zhanglianjie@uniontech.com>
Date: Sun, 6 Mar 2022 15:38:18 +0800
From: Lianjie Zhang <zhanglianjie@...ontech.com>
To: Christoph Lameter <cl@...ux.com>
Cc: Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Roman Gushchin <roman.gushchin@...ux.dev>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Lianjie Zhang <zhanglianjie@...ontech.com>
Subject: [PATCH] mm/slub: helper macro __ATTR_XX to make code more clear
Signed-off-by: Lianjie Zhang <zhanglianjie@...ontech.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
Powered by blists - more mailing lists