From: Mike Kravetz <mike.kravetz@oracle.com>
To: Miaohe Lin <linmiaohe@huawei.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: use helper macro __ATTR_RW
Date: Tue, 22 Feb 2022 16:27:12 -0800 [thread overview]
Message-ID: <6383a6b9-5e03-25e3-922e-97240d7b59ca@oracle.com> (raw)
In-Reply-To: <20220222112731.33479-1-linmiaohe@huawei.com>
On 2/22/22 03:27, Miaohe Lin wrote:
> Use helper macro __ATTR_RW to define HSTATE_ATTR to make code more
> clear. Minor readability improvement.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> mm/hugetlb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Thanks!
I should have noticed and changed that when adding HSTATE_ATTR_WO.
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 1f0cca036f7f..c0405f3c8413 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3498,8 +3498,7 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed)
> 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];
next prev parent reply other threads:[~2022-02-23 0:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 11:27 Miaohe Lin
2022-02-23 0:27 ` Mike Kravetz [this message]
2022-02-24 10:38 ` Muchun Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6383a6b9-5e03-25e3-922e-97240d7b59ca@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox