drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
PATCH 1/1 drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
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
---
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(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +3 -4
@@ -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)
Signature · 1 line
2.25.1
Hi Deepak
Quoted 9 lines · Deepak R Varma
Using
DEFINE_DEBUGFS_ATTRIBUTEmacro withdebugfs_create_file_unsafe()function in place of thedebugfs_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/2369498Issue reported by Coccinelle script:
scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocciSigned-off-by Deepak R Varma <[email protected]>
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
Quoted 36 lines
---
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(-)drivers/gpu/drm/panel/panel-sitronix-st7703.c +3
-4@@ -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)Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi,
Quoted 9 lines · Deepak R Varma
Using
DEFINE_DEBUGFS_ATTRIBUTEmacro withdebugfs_create_file_unsafe()function in place of thedebugfs_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/2369498Issue reported by Coccinelle script:
scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocciSigned-off-by Deepak R Varma <[email protected]>
Cheers,
-- Guido
Quoted 32 lines
---
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(-)drivers/gpu/drm/panel/panel-sitronix-st7703.c +3
-4@@ -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)Signature · 1 line
2.25.1