<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Reviewed-by: Yang Wang <kevinyang.wang@amd.com></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Best Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Kevin</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Candice Li <candice.li@amd.com><br>
<b>Sent:</b> Thursday, April 28, 2022 4:25 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Li, Candice <Candice.Li@amd.com><br>
<b>Subject:</b> [PATCH v3] drm/amdgpu: Fix build warning for TA debugfs interface</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Remove the redundant codes to fix build warning<br>
when CONFIG_DEBUG_FS is disabled.<br>
<br>
Reported-by: Randy Dunlap <rdunlap@infradead.org><br>
Signed-off-by: Candice Li <candice.li@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 40 ++++++++--------------<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.h |  1 -<br>
 2 files changed, 14 insertions(+), 27 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c<br>
index 6806deb098d3f7..0988e00612e515 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c<br>
@@ -24,12 +24,7 @@<br>
 #include "amdgpu.h"<br>
 #include "amdgpu_psp_ta.h"<br>
 <br>
-static const char *TA_IF_FS_NAME = "ta_if";<br>
-<br>
-struct dentry *dir;<br>
-static struct dentry *ta_load_debugfs_dentry;<br>
-static struct dentry *ta_unload_debugfs_dentry;<br>
-static struct dentry *ta_invoke_debugfs_dentry;<br>
+#if defined(CONFIG_DEBUG_FS)<br>
 <br>
 static ssize_t ta_if_load_debugfs_write(struct file *fp, const char *buf,<br>
                                             size_t len, loff_t *off);<br>
@@ -38,7 +33,6 @@ static ssize_t ta_if_unload_debugfs_write(struct file *fp, const char *buf,<br>
 static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf,<br>
                                             size_t len, loff_t *off);<br>
 <br>
-<br>
 static uint32_t get_bin_version(const uint8_t *bin)<br>
 {<br>
         const struct common_firmware_header *hdr =<br>
@@ -74,19 +68,19 @@ static bool is_ta_type_valid(enum ta_type_id ta_type)<br>
 }<br>
 <br>
 static const struct file_operations ta_load_debugfs_fops = {<br>
-       .write   = ta_if_load_debugfs_write,<br>
+       .write  = ta_if_load_debugfs_write,<br>
         .llseek = default_llseek,<br>
         .owner  = THIS_MODULE<br>
 };<br>
 <br>
 static const struct file_operations ta_unload_debugfs_fops = {<br>
-       .write   = ta_if_unload_debugfs_write,<br>
+       .write  = ta_if_unload_debugfs_write,<br>
         .llseek = default_llseek,<br>
         .owner  = THIS_MODULE<br>
 };<br>
 <br>
 static const struct file_operations ta_invoke_debugfs_fops = {<br>
-       .write   = ta_if_invoke_debugfs_write,<br>
+       .write  = ta_if_invoke_debugfs_write,<br>
         .llseek = default_llseek,<br>
         .owner  = THIS_MODULE<br>
 };<br>
@@ -286,31 +280,25 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size<br>
         return ret;<br>
 }<br>
 <br>
-static struct dentry *amdgpu_ta_if_debugfs_create(struct amdgpu_device *adev)<br>
+void amdgpu_ta_if_debugfs_init(struct amdgpu_device *adev)<br>
 {<br>
         struct drm_minor *minor = adev_to_drm(adev)->primary;<br>
 <br>
-       dir = debugfs_create_dir(TA_IF_FS_NAME, minor->debugfs_root);<br>
+       struct dentry *dir = debugfs_create_dir("ta_if", minor->debugfs_root);<br>
 <br>
-       ta_load_debugfs_dentry = debugfs_create_file("ta_load", 0200, dir, adev,<br>
-                                                    &ta_load_debugfs_fops);<br>
+       debugfs_create_file("ta_load", 0200, dir, adev,<br>
+                                    &ta_load_debugfs_fops);<br>
 <br>
-       ta_unload_debugfs_dentry = debugfs_create_file("ta_unload", 0200, dir,<br>
-                                                    adev, &ta_unload_debugfs_fops);<br>
+       debugfs_create_file("ta_unload", 0200, dir,<br>
+                                    adev, &ta_unload_debugfs_fops);<br>
 <br>
-       ta_invoke_debugfs_dentry = debugfs_create_file("ta_invoke", 0200, dir,<br>
-                                                    adev, &ta_invoke_debugfs_fops);<br>
-       return dir;<br>
+       debugfs_create_file("ta_invoke", 0200, dir,<br>
+                                    adev, &ta_invoke_debugfs_fops);<br>
 }<br>
 <br>
+#else<br>
 void amdgpu_ta_if_debugfs_init(struct amdgpu_device *adev)<br>
 {<br>
-#if defined(CONFIG_DEBUG_FS)<br>
-       dir = amdgpu_ta_if_debugfs_create(adev);<br>
-#endif<br>
-}<br>
 <br>
-void amdgpu_ta_if_debugfs_remove(void)<br>
-{<br>
-       debugfs_remove_recursive(dir);<br>
 }<br>
+#endif<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.h<br>
index 883f89d57616d0..cfc1542f63ef94 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.h<br>
@@ -25,6 +25,5 @@<br>
 #define __AMDGPU_PSP_TA_H__<br>
 <br>
 void amdgpu_ta_if_debugfs_init(struct amdgpu_device *adev);<br>
-void amdgpu_ta_if_debugfs_remove(void);<br>
 <br>
 #endif<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>