* [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
@ 2020-10-30 3:31 Deepak R Varma
2020-11-01 9:22 ` Sam Ravnborg
2020-11-01 16:02 ` Guido Günther
0 siblings, 2 replies; 3+ messages in thread
From: Deepak R Varma @ 2020-10-30 3:31 UTC (permalink / raw)
To: outreachy-kernel, Guido Günther, Purism Kernel Team,
Ondrej Jirman, Thierry Reding, Sam Ravnborg, David Airlie,
Daniel Vetter, dri-devel, linux-kernel
Cc: melissa.srw, daniel.vetter, mh12gx2825
Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe()
function in place of the debugfs_create_file() function will make the
file operation struct "reset" aware of the file's lifetime. Additional
details here: https://lists.archive.carbon60.com/linux/kernel/2369498
Issue reported by Coccinelle script:
scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
---
Please Note: This is a Outreachy project task patch.
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index c22e7c49e077..89b71d4f810d 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -502,15 +502,14 @@ static int allpixelson_set(void *data, u64 val)
return 0;
}
-DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
- allpixelson_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(allpixelson_fops, NULL, allpixelson_set, "%llu\n");
static void st7703_debugfs_init(struct st7703 *ctx)
{
ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
- debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
- &allpixelson_fops);
+ debugfs_create_file_unsafe("allpixelson", 0600, ctx->debugfs, ctx,
+ &allpixelson_fops);
}
static void st7703_debugfs_remove(struct st7703 *ctx)
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
2020-10-30 3:31 [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
@ 2020-11-01 9:22 ` Sam Ravnborg
2020-11-01 16:02 ` Guido Günther
1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2020-11-01 9:22 UTC (permalink / raw)
To: Deepak R Varma
Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, daniel.vetter,
Guido Günther, linux-kernel, dri-devel, melissa.srw,
outreachy-kernel, Thierry Reding
Hi Deepak
On Fri, Oct 30, 2020 at 09:01:50AM +0530, Deepak R Varma wrote:
> Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe()
> function in place of the debugfs_create_file() function will make the
> file operation struct "reset" aware of the file's lifetime. Additional
> details here: https://lists.archive.carbon60.com/linux/kernel/2369498
>
> Issue reported by Coccinelle script:
> scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
>
> Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Based on discussions triggered by other patches doing the same
replacement I will ignore this patch for now.
If the conclusions are that this is indeed the right thing to do then
please let us know so we can apply this patch.
Thanks,
Sam
> ---
> Please Note: This is a Outreachy project task patch.
>
> drivers/gpu/drm/panel/panel-sitronix-st7703.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index c22e7c49e077..89b71d4f810d 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -502,15 +502,14 @@ static int allpixelson_set(void *data, u64 val)
> return 0;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
> - allpixelson_set, "%llu\n");
> +DEFINE_DEBUGFS_ATTRIBUTE(allpixelson_fops, NULL, allpixelson_set, "%llu\n");
>
> static void st7703_debugfs_init(struct st7703 *ctx)
> {
> ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
>
> - debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
> - &allpixelson_fops);
> + debugfs_create_file_unsafe("allpixelson", 0600, ctx->debugfs, ctx,
> + &allpixelson_fops);
> }
>
> static void st7703_debugfs_remove(struct st7703 *ctx)
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
2020-10-30 3:31 [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
2020-11-01 9:22 ` Sam Ravnborg
@ 2020-11-01 16:02 ` Guido Günther
1 sibling, 0 replies; 3+ messages in thread
From: Guido Günther @ 2020-11-01 16:02 UTC (permalink / raw)
To: Deepak R Varma
Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, daniel.vetter,
linux-kernel, dri-devel, melissa.srw, outreachy-kernel,
Thierry Reding, Sam Ravnborg
Hi,
On Fri, Oct 30, 2020 at 09:01:50AM +0530, Deepak R Varma wrote:
> Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe()
> function in place of the debugfs_create_file() function will make the
> file operation struct "reset" aware of the file's lifetime. Additional
> details here: https://lists.archive.carbon60.com/linux/kernel/2369498
>
> Issue reported by Coccinelle script:
> scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
>
> Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Cheers,
-- Guido
> ---
> Please Note: This is a Outreachy project task patch.
>
> drivers/gpu/drm/panel/panel-sitronix-st7703.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index c22e7c49e077..89b71d4f810d 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -502,15 +502,14 @@ static int allpixelson_set(void *data, u64 val)
> return 0;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
> - allpixelson_set, "%llu\n");
> +DEFINE_DEBUGFS_ATTRIBUTE(allpixelson_fops, NULL, allpixelson_set, "%llu\n");
>
> static void st7703_debugfs_init(struct st7703 *ctx)
> {
> ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
>
> - debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
> - &allpixelson_fops);
> + debugfs_create_file_unsafe("allpixelson", 0600, ctx->debugfs, ctx,
> + &allpixelson_fops);
> }
>
> static void st7703_debugfs_remove(struct st7703 *ctx)
> --
> 2.25.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-01 16:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 3:31 [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
2020-11-01 9:22 ` Sam Ravnborg
2020-11-01 16:02 ` Guido Günther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox