linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] mm: kfence: convert to DEFINE_SEQ_ATTRIBUTE
  2022-09-09  8:31 [PATCH] mm: kfence: convert to DEFINE_SEQ_ATTRIBUTE Liu Shixin
@ 2022-09-09  8:19 ` Marco Elver
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Elver @ 2022-09-09  8:19 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Alexander Potapenko, Dmitry Vyukov, Andrew Morton, kasan-dev,
	linux-mm, linux-kernel, Kefeng Wang

On Fri, Sep 09, 2022 at 04:31PM +0800, 'Liu Shixin' via kasan-dev wrote:
> Use DEFINE_SEQ_ATTRIBUTE helper macro to simplify the code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>

Reviewed-by: Marco Elver <elver@google.com>
Tested-by: Marco Elver <elver@google.com>

> ---
>  mm/kfence/core.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/mm/kfence/core.c b/mm/kfence/core.c
> index 8c08ae2101d7..26de62a51665 100644
> --- a/mm/kfence/core.c
> +++ b/mm/kfence/core.c
> @@ -719,24 +719,13 @@ static int show_object(struct seq_file *seq, void *v)
>  	return 0;
>  }
>  
> -static const struct seq_operations object_seqops = {
> +static const struct seq_operations objects_sops = {
>  	.start = start_object,
>  	.next = next_object,
>  	.stop = stop_object,
>  	.show = show_object,
>  };
> -
> -static int open_objects(struct inode *inode, struct file *file)
> -{
> -	return seq_open(file, &object_seqops);
> -}
> -
> -static const struct file_operations objects_fops = {
> -	.open = open_objects,
> -	.read = seq_read,
> -	.llseek = seq_lseek,
> -	.release = seq_release,
> -};
> +DEFINE_SEQ_ATTRIBUTE(objects);
>  
>  static int __init kfence_debugfs_init(void)
>  {
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] mm: kfence: convert to DEFINE_SEQ_ATTRIBUTE
@ 2022-09-09  8:31 Liu Shixin
  2022-09-09  8:19 ` Marco Elver
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Shixin @ 2022-09-09  8:31 UTC (permalink / raw)
  To: Alexander Potapenko, Marco Elver, Dmitry Vyukov, Andrew Morton
  Cc: kasan-dev, linux-mm, linux-kernel, Liu Shixin, Kefeng Wang

Use DEFINE_SEQ_ATTRIBUTE helper macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 mm/kfence/core.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/mm/kfence/core.c b/mm/kfence/core.c
index 8c08ae2101d7..26de62a51665 100644
--- a/mm/kfence/core.c
+++ b/mm/kfence/core.c
@@ -719,24 +719,13 @@ static int show_object(struct seq_file *seq, void *v)
 	return 0;
 }
 
-static const struct seq_operations object_seqops = {
+static const struct seq_operations objects_sops = {
 	.start = start_object,
 	.next = next_object,
 	.stop = stop_object,
 	.show = show_object,
 };
-
-static int open_objects(struct inode *inode, struct file *file)
-{
-	return seq_open(file, &object_seqops);
-}
-
-static const struct file_operations objects_fops = {
-	.open = open_objects,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = seq_release,
-};
+DEFINE_SEQ_ATTRIBUTE(objects);
 
 static int __init kfence_debugfs_init(void)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-09  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  8:31 [PATCH] mm: kfence: convert to DEFINE_SEQ_ATTRIBUTE Liu Shixin
2022-09-09  8:19 ` Marco Elver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).