linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: msm: adreno: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
@ 2020-10-29 19:02 Deepak R Varma
  2020-10-29 19:04 ` [PATCH 2/2] drm: msm: adreno: improve code indentation & alignment Deepak R Varma
  0 siblings, 1 reply; 2+ messages in thread
From: Deepak R Varma @ 2020-10-29 19:02 UTC (permalink / raw)
  To: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, linux-arm-msm,
	dri-devel, freedreno, linux-kernel, outreachy-kernel
  Cc: 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 project task specific patch.

 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index fc2c905b6c9e..ffe1fb9be155 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -138,7 +138,7 @@ reset_set(void *data, u64 val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n");
 
 
 void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
@@ -154,6 +154,6 @@ void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
 				 ARRAY_SIZE(a5xx_debugfs_list),
 				 minor->debugfs_root, minor);
 
-	debugfs_create_file("reset", S_IWUGO, minor->debugfs_root, dev,
-			    &reset_fops);
+	debugfs_create_file_unsafe("reset", S_IWUGO, minor->debugfs_root, dev,
+				&reset_fops);
 }
-- 
2.25.1


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

* [PATCH 2/2] drm: msm: adreno: improve code indentation & alignment
  2020-10-29 19:02 [PATCH 1/2] drm: msm: adreno: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
@ 2020-10-29 19:04 ` Deepak R Varma
  0 siblings, 0 replies; 2+ messages in thread
From: Deepak R Varma @ 2020-10-29 19:04 UTC (permalink / raw)
  To: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, linux-arm-msm,
	dri-devel, freedreno, linux-kernel, outreachy-kernel
  Cc: mh12gx2825

Align instructions split across multiple lines as per the coding
standards. Issue flagged by checkpatch script.

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
---
Please note: This is a project task specific patch.

 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index ffe1fb9be155..ac9296f314be 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -20,7 +20,7 @@ static void pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
 	for (i = 0; i < 36; i++) {
 		gpu_write(gpu, REG_A5XX_CP_PFP_STAT_ADDR, i);
 		drm_printf(p, "  %02x: %08x\n", i,
-			gpu_read(gpu, REG_A5XX_CP_PFP_STAT_DATA));
+			   gpu_read(gpu, REG_A5XX_CP_PFP_STAT_DATA));
 	}
 }
 
@@ -33,7 +33,7 @@ static void me_print(struct msm_gpu *gpu, struct drm_printer *p)
 	for (i = 0; i < 29; i++) {
 		gpu_write(gpu, REG_A5XX_CP_ME_STAT_ADDR, i);
 		drm_printf(p, "  %02x: %08x\n", i,
-			gpu_read(gpu, REG_A5XX_CP_ME_STAT_DATA));
+			   gpu_read(gpu, REG_A5XX_CP_ME_STAT_DATA));
 	}
 }
 
@@ -46,7 +46,7 @@ static void meq_print(struct msm_gpu *gpu, struct drm_printer *p)
 
 	for (i = 0; i < 64; i++) {
 		drm_printf(p, "  %02x: %08x\n", i,
-			gpu_read(gpu, REG_A5XX_CP_MEQ_DBG_DATA));
+			   gpu_read(gpu, REG_A5XX_CP_MEQ_DBG_DATA));
 	}
 }
 
@@ -63,7 +63,7 @@ static void roq_print(struct msm_gpu *gpu, struct drm_printer *p)
 		for (j = 0; j < 4; j++)
 			val[j] = gpu_read(gpu, REG_A5XX_CP_ROQ_DBG_DATA);
 		drm_printf(p, "  %02x: %08x %08x %08x %08x\n", i,
-			val[0], val[1], val[2], val[3]);
+			   val[0], val[1], val[2], val[3]);
 	}
 }
 
@@ -155,5 +155,5 @@ void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
 				 minor->debugfs_root, minor);
 
 	debugfs_create_file_unsafe("reset", S_IWUGO, minor->debugfs_root, dev,
-				&reset_fops);
+				   &reset_fops);
 }
-- 
2.25.1


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

end of thread, other threads:[~2020-10-29 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 19:02 [PATCH 1/2] drm: msm: adreno: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
2020-10-29 19:04 ` [PATCH 2/2] drm: msm: adreno: improve code indentation & alignment Deepak R Varma

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).