drm/amd/pm: mark irq functions as 'static'
PATCH 1/5 drm/amd/pm: mark irq functions as 'static'
From: Arnd Bergmann <[email protected]>
Two newly added functions cause a warning because they lack a prototype:
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:1328:5: error: no previous prototype for 'smu_v13_0_6_set_irq_state' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:1368:5: error: no previous prototype for 'smu_v13_0_6_register_irq_handler' [-Werror=missing-prototypes]
They are only used locally, so just mark them static.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2 -2
@@ -1325,7 +1325,7 @@ static int smu_v13_0_6_irq_process(struct amdgpu_device *adev,return 0 ; } -int smu_v13_0_6_set_irq_state (struct amdgpu_device *adev, +static int smu_v13_0_6_set_irq_state (struct amdgpu_device *adev,struct amdgpu_irq_src *source,unsigned tyep,enum amdgpu_interrupt_state state)
@@ -1365,7 +1365,7 @@ static const struct amdgpu_irq_src_funcs smu_v13_0_6_irq_funcs = .process = smu_v13_0_6_irq_process, }; -int smu_v13_0_6_register_irq_handler (struct smu_context *smu) +static int smu_v13_0_6_register_irq_handler (struct smu_context *smu) {struct amdgpu_device *adev = smu->adev;struct amdgpu_irq_src *irq_src = &smu->irq_source;
Signature · 1 line
2.39.2
PATCH 2/5 drm/amdkfd: mark local functions as static
From: Arnd Bergmann <[email protected]>
The file was newly added and causes some -Wmissing-prototype warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:57:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_load' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:126:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_dump' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:163:6: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_is_occupied' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:181:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_destroy' [-Werror=missing-prototypes]
Mark these all as 'static' since there are no outside callers.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +4 -4
@@ -54,7 +54,7 @@ static uint32_t get_sdma_rlc_reg_offset(struct amdgpu_device *adev,return retval; } -int kgd_gfx_v9_4_3_hqd_sdma_load (struct amdgpu_device *adev,void *mqd, +static int kgd_gfx_v9_4_3_hqd_sdma_load (struct amdgpu_device *adev,void *mqd,uint32_t __user *wptr,struct mm_struct *mm) {struct v9_sdma_mqd *m;
@@ -123,7 +123,7 @@ int kgd_gfx_v9_4_3_hqd_sdma_load(struct amdgpu_device *adev, void *mqd,return 0 ; } -int kgd_gfx_v9_4_3_hqd_sdma_dump (struct amdgpu_device *adev, +static int kgd_gfx_v9_4_3_hqd_sdma_dump (struct amdgpu_device *adev,uint32_t engine_id,uint32_t queue_id,uint32_t (**dump)[2 ],uint32_t *n_regs) {
@@ -160,7 +160,7 @@ int kgd_gfx_v9_4_3_hqd_sdma_dump(struct amdgpu_device *adev,return 0 ; } -bool kgd_gfx_v9_4_3_hqd_sdma_is_occupied (struct amdgpu_device *adev,void *mqd) +static bool kgd_gfx_v9_4_3_hqd_sdma_is_occupied (struct amdgpu_device *adev,void *mqd) {struct v9_sdma_mqd *m;uint32_t sdma_rlc_reg_offset;
@@ -178,7 +178,7 @@ bool kgd_gfx_v9_4_3_hqd_sdma_is_occupied(struct amdgpu_device *adev, void *mqd)return false; } -int kgd_gfx_v9_4_3_hqd_sdma_destroy (struct amdgpu_device *adev,void *mqd, +static int kgd_gfx_v9_4_3_hqd_sdma_destroy (struct amdgpu_device *adev,void *mqd,unsigned int utimeout) {struct v9_sdma_mqd *m;
Signature · 1 line
2.39.2
PATCH 3/5 drm/amdgpu:mark aqua_vanjaram_reg_init.c function as static
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
A few newly added global functions have no prototype, which causes warnings:
drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:169:5: error: no previous prototype for 'aqua_vanjaram_select_scheds' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:310:5: error: no previous prototype for '__aqua_vanjaram_get_xcc_per_xcp' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:337:5: error: no previous prototype for '__aqua_vanjaram_get_xcp_ip_info' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:593:5: error: no previous prototype for 'aqua_vanjaram_get_xcp_ip_details' [-Werror=missing-prototypes]
There are no callers from other files, so just mark them as 'static'.
--- drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c +4 -4
@@ -166,7 +166,7 @@ static int aqua_vanjaram_update_partition_sched_list(struct amdgpu_device *adev)return aqua_vanjaram_xcp_sched_list_update (adev); } -int aqua_vanjaram_select_scheds( +static int aqua_vanjaram_select_scheds( struct amdgpu_device *adev, u32 hw_ip, u32 hw_prio,
@@ -307,7 +307,7 @@ static int aqua_vanjaram_query_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr)return mode; } -int __aqua_vanjaram_get_xcc_per_xcp (struct amdgpu_xcp_mgr *xcp_mgr,int mode) +static int __aqua_vanjaram_get_xcc_per_xcp (struct amdgpu_xcp_mgr *xcp_mgr,int mode) {int num_xcc, num_xcc_per_xcp =0 ;
@@ -334,7 +334,7 @@ int __aqua_vanjaram_get_xcc_per_xcp(struct amdgpu_xcp_mgr *xcp_mgr, int mode)return num_xcc_per_xcp; } -int __aqua_vanjaram_get_xcp_ip_info (struct amdgpu_xcp_mgr *xcp_mgr,int xcp_id, +static int __aqua_vanjaram_get_xcp_ip_info (struct amdgpu_xcp_mgr *xcp_mgr,int xcp_id,enum AMDGPU_XCP_IP_BLOCK ip_id,struct amdgpu_xcp_ip *ip) {
@@ -590,7 +590,7 @@ static int aqua_vanjaram_get_xcp_mem_id(struct amdgpu_xcp_mgr *xcp_mgr,return r; } -int aqua_vanjaram_get_xcp_ip_details (struct amdgpu_xcp_mgr *xcp_mgr,int xcp_id, +static int aqua_vanjaram_get_xcp_ip_details (struct amdgpu_xcp_mgr *xcp_mgr,int xcp_id,enum AMDGPU_XCP_IP_BLOCK ip_id,struct amdgpu_xcp_ip *ip) {
Signature · 1 line
2.39.2
PATCH 4/5 drm/amdgpu: use %pad format string for dma_addr_t
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
DMA addresses can be shorter than u64, which results in a broken debug output:
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c: In function 'amdgpu_gart_table_ram_alloc':drivers/gpu/drm/amd/amdgpu/amdgpu.h:41:22: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=] drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:146:9: note: in expansion of macro 'dev_info'
146 | dev_info(adev->dev, "%s dma_addr:%llx\n", __func__, dma_addr);
Use the special %pad format string and pass the DMA address by reference.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -1
@@ -143,7 +143,7 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev)return -EFAULT ; } -dev_info (adev->dev,"%s dma_addr:%llx\n" , __func__, dma_addr); +dev_info (adev->dev,"%s dma_addr:%pad\n" , __func__, &dma_addr);/* Create SG table */ sg =kmalloc (sizeof (*sg),GFP_KERNEL );if (!sg) {
Signature · 1 line
2.39.2
PATCH 5/5 drm/amdgpu: fix acpi build warnings
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Two newly introduced functions are in the global namespace but have no prototypes or callers outside of amdgpu_acpi.c, another function is static but only has a caller inside of an #ifdef:
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:902:13: error: no previous prototype for 'amdgpu_acpi_get_node_id' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:928:30: error: no previous prototype for 'amdgpu_acpi_get_dev' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:860:33: error: 'amdgpu_acpi_get_numa_info' defined but not used [-Werror=unused-function]
Avoid the warnings by marking all of them static and ensuring that the compiler is able to see the callsites.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +5 -6
@@ -899,13 +899,15 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm)* * Returns ACPI STATUS OK with Node ID on success or the corresponding failure reason */ -acpi_status amdgpu_acpi_get_node_id (acpi_handle handle, +static acpi_status amdgpu_acpi_get_node_id (acpi_handle handle,struct amdgpu_numa_info **numa_info) { -#ifdef CONFIG_ACPI_NUMA u64 pxm;acpi_status status; +if (!IS_ENABLED (CONFIG_ACPI_NUMA )) +return_ACPI_STATUS (AE_NOT_EXIST ); +if (!numa_info)return_ACPI_STATUS (AE_ERROR );
@@ -920,12 +922,9 @@ acpi_status amdgpu_acpi_get_node_id(acpi_handle handle,return_ACPI_STATUS (AE_ERROR );return_ACPI_STATUS (AE_OK ); -#else -return_ACPI_STATUS (AE_NOT_EXIST ); -#endif } -struct amdgpu_acpi_dev_info *amdgpu_acpi_get_dev (u16 bdf) +static struct amdgpu_acpi_dev_info *amdgpu_acpi_get_dev (u16 bdf) {struct amdgpu_acpi_dev_info *acpi_dev;
Signature · 1 line
2.39.2
Alex Deucher
AppliedRe: [PATCH 5/5] drm/amdgpu: fix acpi build warnings
Applied the series. Thanks!
Alex
Quoted 60 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Two newly introduced functions are in the global namespace but have no prototypes or callers outside of
amdgpu_acpi.c, another function is static but only has a caller inside of an #ifdef:
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:902:13: error: no previous prototype for 'amdgpu_acpi_get_node_id' [-Werror=missing-prototypes]drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:928:30: error: no previous prototype for 'amdgpu_acpi_get_dev' [-Werror=missing-prototypes]drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:860:33: error: 'amdgpu_acpi_get_numa_info' defined but not used [-Werror=unused-function]Avoid the warnings by marking all of them static and ensuring that the compiler is able to see the callsites.
Fixes c34db97b8217 ("drm/amdgpu: Add API to get numa information of XCC")Fixes 1f6f659d06e1 ("drm/amdgpu: Store additional numa node information")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +5
-7@@ -899,13 +899,15 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm)* * Returns ACPI STATUS OK with Node ID on success or the corresponding failure reason */ -acpi_status amdgpu_acpi_get_node_id (acpi_handle handle, +static acpi_status amdgpu_acpi_get_node_id (acpi_handle handle,struct amdgpu_numa_info **numa_info) { -#ifdef CONFIG_ACPI_NUMA u64 pxm;acpi_status status; +if (!IS_ENABLED (CONFIG_ACPI_NUMA )) +return_ACPI_STATUS (AE_NOT_EXIST ); +if (!numa_info)return_ACPI_STATUS (AE_ERROR );@@ -920,12 +922,9 @@ acpi_status amdgpu_acpi_get_node_id(acpi_handle handle,return_ACPI_STATUS (AE_ERROR );return_ACPI_STATUS (AE_OK ); -#else -return_ACPI_STATUS (AE_NOT_EXIST ); -#endif } -struct amdgpu_acpi_dev_info *amdgpu_acpi_get_dev (u16 bdf) +static struct amdgpu_acpi_dev_info *amdgpu_acpi_get_dev (u16 bdf) {struct amdgpu_acpi_dev_info *acpi_dev; --2.39.2