2020-07-16 09:04:29

by Qinglang Miao

[permalink] [raw]
Subject: [PATCH -next] s390/mm: Convert to DEFINE_SHOW_ATTRIBUTE

From: Chen Huang <[email protected]>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Chen Huang <[email protected]>
---
arch/s390/mm/dump_pagetables.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/s390/mm/dump_pagetables.c b/arch/s390/mm/dump_pagetables.c
index 9adb10a05..ce65bea17 100644
--- a/arch/s390/mm/dump_pagetables.c
+++ b/arch/s390/mm/dump_pagetables.c
@@ -261,17 +261,7 @@ static int ptdump_show(struct seq_file *m, void *v)
return 0;
}

-static int ptdump_open(struct inode *inode, struct file *filp)
-{
- return single_open(filp, ptdump_show, NULL);
-}
-
-static const struct file_operations ptdump_fops = {
- .open = ptdump_open,
- .read_iter = seq_read_iter,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(ptdump);

static int pt_dump_init(void)
{
--
2.17.1


2020-07-16 11:27:17

by Heiko Carstens

[permalink] [raw]
Subject: Re: [PATCH -next] s390/mm: Convert to DEFINE_SHOW_ATTRIBUTE

On Thu, Jul 16, 2020 at 05:07:03PM +0800, Qinglang Miao wrote:
> From: Chen Huang <[email protected]>
>
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Chen Huang <[email protected]>
> ---
> arch/s390/mm/dump_pagetables.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)

Thanks for the patch, however we are going to convert the s390 page
table dumper to generic code, so I'm not going to apply any cleanup
patches for this code anymore.

2020-07-17 01:20:37

by Qinglang Miao

[permalink] [raw]
Subject: Re: [PATCH -next] s390/mm: Convert to DEFINE_SHOW_ATTRIBUTE


?? 2020/7/16 19:26, Heiko Carstens ะด??:
> On Thu, Jul 16, 2020 at 05:07:03PM +0800, Qinglang Miao wrote:
>> From: Chen Huang <[email protected]>
>>
>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>>
>> Signed-off-by: Chen Huang <[email protected]>
>> ---
>> arch/s390/mm/dump_pagetables.c | 12 +-----------
>> 1 file changed, 1 insertion(+), 11 deletions(-)
> Thanks for the patch, however we are going to convert the s390 page
> table dumper to generic code, so I'm not going to apply any cleanup
> patches for this code anymore.
Thanks for your replay, I'm glad to know that.