提交 e48333b6 编写于 作者: R Rikard Falkeborn 提交者: Linus Torvalds

mm/swap_state: constify static struct attribute_group

The only usage of swap_attr_group is to pass its address to
sysfs_create_group() which takes a pointer to const attribute_group.  Make
it const to allow the compiler to put it in read-only memory.

Link: https://lkml.kernel.org/r/20210201233254.91809-1-rikard.falkeborn@gmail.comSigned-off-by: NRikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: NAmy Parker <enbyamy@gmail.com>
Acked-by: N"Huang, Ying" <ying.huang@intel.com>
Reviewed-by: NMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 25eaab43
...@@ -927,7 +927,7 @@ static struct attribute *swap_attrs[] = { ...@@ -927,7 +927,7 @@ static struct attribute *swap_attrs[] = {
NULL, NULL,
}; };
static struct attribute_group swap_attr_group = { static const struct attribute_group swap_attr_group = {
.attrs = swap_attrs, .attrs = swap_attrs,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册