* [PATCH 2/5] mm: slub: constify attribute_group structures.
@ 2017-07-27 12:06 Arvind Yadav
2017-07-27 14:36 ` Christopher Lameter
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-07-27 12:06 UTC (permalink / raw)
To: cl, penberg, rientjes, iamjoonsoo.kim, akpm; +Cc: linux-mm, linux-kernel
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work with
const attribute_group. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slub.c b/mm/slub.c
index 1d3f983..72af363 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5423,7 +5423,7 @@ static void clear_stat(struct kmem_cache *s, enum stat_item si)
NULL
};
-static struct attribute_group slab_attr_group = {
+static const struct attribute_group slab_attr_group = {
.attrs = slab_attrs,
};
--
1.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/5] mm: slub: constify attribute_group structures.
2017-07-27 12:06 [PATCH 2/5] mm: slub: constify attribute_group structures Arvind Yadav
@ 2017-07-27 14:36 ` Christopher Lameter
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Lameter @ 2017-07-27 14:36 UTC (permalink / raw)
To: Arvind Yadav
Cc: penberg, rientjes, iamjoonsoo.kim, akpm, linux-mm, linux-kernel
On Thu, 27 Jul 2017, Arvind Yadav wrote:
> attribute_group are not supposed to change at runtime. All functions
> working with attribute_group provided by <linux/sysfs.h> work with
> const attribute_group. So mark the non-const structs as const.
Acked-by: Christoph Lameter <cl@linux.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-27 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 12:06 [PATCH 2/5] mm: slub: constify attribute_group structures Arvind Yadav
2017-07-27 14:36 ` Christopher Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).