memory tier: use helper macro __ATTR_RW()
Use helper macro __ATTR_RW to define numa demotion attributes. Minor readability improvement. Link: https://lkml.kernel.org/r/20230715035111.2656784-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
4ae6944d15
commit
8d3a7d797c
|
@ -672,16 +672,16 @@ bool numa_demotion_enabled = false;
|
||||||
|
|
||||||
#ifdef CONFIG_MIGRATION
|
#ifdef CONFIG_MIGRATION
|
||||||
#ifdef CONFIG_SYSFS
|
#ifdef CONFIG_SYSFS
|
||||||
static ssize_t numa_demotion_enabled_show(struct kobject *kobj,
|
static ssize_t demotion_enabled_show(struct kobject *kobj,
|
||||||
struct kobj_attribute *attr, char *buf)
|
struct kobj_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
return sysfs_emit(buf, "%s\n",
|
return sysfs_emit(buf, "%s\n",
|
||||||
numa_demotion_enabled ? "true" : "false");
|
numa_demotion_enabled ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t numa_demotion_enabled_store(struct kobject *kobj,
|
static ssize_t demotion_enabled_store(struct kobject *kobj,
|
||||||
struct kobj_attribute *attr,
|
struct kobj_attribute *attr,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
|
@ -693,8 +693,7 @@ static ssize_t numa_demotion_enabled_store(struct kobject *kobj,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct kobj_attribute numa_demotion_enabled_attr =
|
static struct kobj_attribute numa_demotion_enabled_attr =
|
||||||
__ATTR(demotion_enabled, 0644, numa_demotion_enabled_show,
|
__ATTR_RW(demotion_enabled);
|
||||||
numa_demotion_enabled_store);
|
|
||||||
|
|
||||||
static struct attribute *numa_attrs[] = {
|
static struct attribute *numa_attrs[] = {
|
||||||
&numa_demotion_enabled_attr.attr,
|
&numa_demotion_enabled_attr.attr,
|
||||||
|
|
Loading…
Reference in New Issue