Skip to contentSkip to conversation

drm/amdgpu: declare static function to fix compiler warning

PATCH In review Guchun Chen 2 participants 2 messages Nov 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: declare static function to fix compiler warning

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:503:6: warning: no previous prototype for function 'release_psp_cmd_buf' [-Wmissing-prototypes]

void release_psp_cmd_buf(struct psp_context *psp)

        ^

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:503:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void release_psp_cmd_buf(struct psp_context *psp)
^
static
1 warning generated.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
index c641f84649d6..b48d68d30d80 100644
@@ -518,7 +518,7 @@ static struct psp_gfx_cmd_resp *acquire_psp_cmd_buf(struct psp_context *psp)
 	return cmd;
 }
 
-void release_psp_cmd_buf(struct psp_context *psp)
+static void release_psp_cmd_buf(struct psp_context *psp)
 {
 	mutex_unlock(&psp->mutex);
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only]

It is reasonable to modify it to a static function, which can be matched with function of acquire_psp_cmd_buf() .

Best Regards,
Kevin
________________________________
From: amd-gfx <[email protected]> on behalf of Guchun Chen <[email protected]>
Sent: Friday, November 26, 2021 1:16 PM
To: [email protected] <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; Clements, John <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: declare static function to fix compiler warning

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:503:6: warning: no previous prototype for function 'release_psp_cmd_buf' [-Wmissing-prototypes]

void release_psp_cmd_buf(struct psp_context *psp)

        ^

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:503:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void release_psp_cmd_buf(struct psp_context *psp)
^
static
1 warning generated.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
index c641f84649d6..b48d68d30d80 100644
@@ -518,7 +518,7 @@ static struct psp_gfx_cmd_resp *acquire_psp_cmd_buf(struct psp_context *psp)
         return cmd;
 }
 
-void release_psp_cmd_buf(struct psp_context *psp)
+static void release_psp_cmd_buf(struct psp_context *psp)
 {
         mutex_unlock(&psp->mutex);
 }

--
2.17.1