diff mbox series

[02/15] mm/swap: use helper macro __ATTR_RW

Message ID 20220509131416.17553-3-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for swap | expand

Commit Message

Miaohe Lin May 9, 2022, 1:14 p.m. UTC
Use helper macro __ATTR_RW to define vma_ra_enabled_attr to make code more
clear. Minor readability improvement.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/swap_state.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

David Hildenbrand May 12, 2022, 1:28 p.m. UTC | #1
On 09.05.22 15:14, Miaohe Lin wrote:
> Use helper macro __ATTR_RW to define vma_ra_enabled_attr to make code more
> clear. Minor readability improvement.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: David Hildenbrand <david@redhat.com>
Oscar Salvador May 18, 2022, 8:46 a.m. UTC | #2
On Mon, May 09, 2022 at 09:14:03PM +0800, Miaohe Lin wrote:
> Use helper macro __ATTR_RW to define vma_ra_enabled_attr to make code more
> clear. Minor readability improvement.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>

> ---
>  mm/swap_state.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/swap_state.c b/mm/swap_state.c
> index 240b39ed5922..9f99d8137ffd 100644
> --- a/mm/swap_state.c
> +++ b/mm/swap_state.c
> @@ -881,9 +881,7 @@ static ssize_t vma_ra_enabled_store(struct kobject *kobj,
>  
>  	return count;
>  }
> -static struct kobj_attribute vma_ra_enabled_attr =
> -	__ATTR(vma_ra_enabled, 0644, vma_ra_enabled_show,
> -	       vma_ra_enabled_store);
> +static struct kobj_attribute vma_ra_enabled_attr = __ATTR_RW(vma_ra_enabled);
>  
>  static struct attribute *swap_attrs[] = {
>  	&vma_ra_enabled_attr.attr,
> -- 
> 2.23.0
> 
>
diff mbox series

Patch

diff --git a/mm/swap_state.c b/mm/swap_state.c
index 240b39ed5922..9f99d8137ffd 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -881,9 +881,7 @@  static ssize_t vma_ra_enabled_store(struct kobject *kobj,
 
 	return count;
 }
-static struct kobj_attribute vma_ra_enabled_attr =
-	__ATTR(vma_ra_enabled, 0644, vma_ra_enabled_show,
-	       vma_ra_enabled_store);
+static struct kobj_attribute vma_ra_enabled_attr = __ATTR_RW(vma_ra_enabled);
 
 static struct attribute *swap_attrs[] = {
 	&vma_ra_enabled_attr.attr,