--- a/mm/hugetlb.c~mm-hugetlb-use-helper-macro-__attr_rw +++ a/mm/hugetlb.c @@ -3499,8 +3499,7 @@ static int demote_pool_huge_page(struct static struct kobj_attribute _name##_attr = __ATTR_WO(_name) #define HSTATE_ATTR(_name) \ - static struct kobj_attribute _name##_attr = \ - __ATTR(_name, 0644, _name##_show, _name##_store) + static struct kobj_attribute _name##_attr = __ATTR_RW(_name) static struct kobject *hugepages_kobj; static struct kobject *hstate_kobjs[HUGE_MAX_HSTATE];