<div dir="ltr">in drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c and drivers/gpu/drm/amd/amdgpu/cz_smc.c, there are two functions named cz_write_smc_sram_dword, but these two functions only have the same name, but in fact they are different functions, even their declarations is different.</div><div class="gmail_extra"><br><div class="gmail_quote">On 3 September 2016 at 14:11, Edward O'Callaghan <span dir="ltr"><<a href="mailto:funfunctor@folklore1984.net" target="_blank">funfunctor@folklore1984.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reviewed-by: Edward O'Callaghan <<a href="mailto:funfunctor@folklore1984.net">funfunctor@folklore1984.net</a>><br>
<br>
Also, I just noticed cz_write_smc_sram_dword() and if I am not mistaken<br>
they seems identical in both:<br>
drivers/gpu/drm/amd/powerplay/<wbr>smumgr/cz_smumgr.c and,<br>
drivers/gpu/drm/amd/amdgpu/cz_<wbr>smc.c<br>
with a personal preference to the powerplay version I suppose.<br>
<br>
Similar story with cz_send_msg_to_smc_async() *I think* but the<br>
powerplay one uses some insane macro chain that dispatches to some<br>
function called smum_wait_for_register_<wbr>unequal(), quite hard to follow..<br>
<br>
Any way, that is out of scope of the patch here.<br>
<br>
Kind Regards,<br>
Edward.<br>
<div class="HOEnZb"><div class="h5"><br>
On 09/03/2016 03:57 PM, Baoyou Xie wrote:<br>
> We get a few warnings when building kernel with W=1:<br>
> drivers/gpu/drm/amd/amdgpu/cz_<wbr>smc.c:51:5: warning: no previous prototype for 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]<br>
> drivers/gpu/drm/amd/amdgpu/cz_<wbr>smc.c:143:5: warning: no previous prototype for 'cz_write_smc_sram_dword' [-Wmissing-prototypes]<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>iceland_smc.c:124:6: warning: no previous prototype for 'iceland_start_smc' [-Wmissing-prototypes]<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>gfx_v8_0.c:3926:6: warning: no previous prototype for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_job.c:94:6: warning: no previous prototype for 'amdgpu_job_free_cb' [-Wmissing-prototypes]<br>
> ....<br>
><br>
> In fact, these functions are only used in the file in which they are<br>
> declared and don't need a declaration, but can be made static.<br>
> So this patch marks these functions with 'static'.<br>
><br>
> Signed-off-by: Baoyou Xie <<a href="mailto:baoyou.xie@linaro.org">baoyou.xie@linaro.org</a>><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cgs.c | 4 ++--<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cs.c | 2 +-<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_job.c | 2 +-<br>
> drivers/gpu/drm/amd/amdgpu/cz_<wbr>smc.c | 4 ++--<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>gfx_v8_0.c | 2 +-<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>iceland_smc.c | 8 ++++----<br>
> 6 files changed, 11 insertions(+), 11 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cgs.c<br>
> index bc0440f..a831218 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cgs.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cgs.c<br>
> @@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device *cgs_device, unsigned src_id, un<br>
> return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);<br>
> }<br>
><br>
> -int amdgpu_cgs_set_clockgating_<wbr>state(struct cgs_device *cgs_device,<br>
> +static int amdgpu_cgs_set_clockgating_<wbr>state(struct cgs_device *cgs_device,<br>
> enum amd_ip_block_type block_type,<br>
> enum amd_clockgating_state state)<br>
> {<br>
> @@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_<wbr>state(struct cgs_device *cgs_device,<br>
> return r;<br>
> }<br>
><br>
> -int amdgpu_cgs_set_powergating_<wbr>state(struct cgs_device *cgs_device,<br>
> +static int amdgpu_cgs_set_powergating_<wbr>state(struct cgs_device *cgs_device,<br>
> enum amd_ip_block_type block_type,<br>
> enum amd_powergating_state state)<br>
> {<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cs.c<br>
> index 0307ff5..f65bdaf 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cs.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_cs.c<br>
> @@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_<wbr>moves(struct amdgpu_device *adev)<br>
> return max(bytes_moved_threshold, 1024*1024ull);<br>
> }<br>
><br>
> -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,<br>
> +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,<br>
> struct list_head *validated)<br>
> {<br>
> struct amdgpu_bo_list_entry *lobj;<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_job.c<br>
> index 6674d40..31bfe3a 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_job.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_job.c<br>
> @@ -91,7 +91,7 @@ void amdgpu_job_free_resources(<wbr>struct amdgpu_job *job)<br>
> amdgpu_ib_free(job->adev, &job->ibs[i], f);<br>
> }<br>
><br>
> -void amdgpu_job_free_cb(struct amd_sched_job *s_job)<br>
> +static void amdgpu_job_free_cb(struct amd_sched_job *s_job)<br>
> {<br>
> struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>cz_smc.c b/drivers/gpu/drm/amd/amdgpu/<wbr>cz_smc.c<br>
> index ac7fee7..c80c2e9 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>cz_smc.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>cz_smc.c<br>
> @@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct amdgpu_device *adev)<br>
> return priv;<br>
> }<br>
><br>
> -int cz_send_msg_to_smc_async(<wbr>struct amdgpu_device *adev, u16 msg)<br>
> +static int cz_send_msg_to_smc_async(<wbr>struct amdgpu_device *adev, u16 msg)<br>
> {<br>
> int i;<br>
> u32 content = 0, tmp;<br>
> @@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,<br>
> return 0;<br>
> }<br>
><br>
> -int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,<br>
> +static int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,<br>
> u32 value, u32 limit)<br>
> {<br>
> int ret;<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/<wbr>gfx_v8_0.c<br>
> index bff8668..6997f7c 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>gfx_v8_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>gfx_v8_0.c<br>
> @@ -3923,7 +3923,7 @@ static void gfx_v8_0_init_pg(struct amdgpu_device *adev)<br>
> }<br>
> }<br>
><br>
> -void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)<br>
> +static void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)<br>
> {<br>
> u32 tmp = RREG32(mmRLC_CNTL);<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>iceland_smc.c b/drivers/gpu/drm/amd/amdgpu/<wbr>iceland_smc.c<br>
> index 2118399..ef7c27d 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>iceland_smc.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>iceland_smc.c<br>
> @@ -121,7 +121,7 @@ out:<br>
> return result;<br>
> }<br>
><br>
> -void iceland_start_smc(struct amdgpu_device *adev)<br>
> +static void iceland_start_smc(struct amdgpu_device *adev)<br>
> {<br>
> uint32_t val = RREG32_SMC(ixSMC_SYSCON_RESET_<wbr>CNTL);<br>
><br>
> @@ -129,7 +129,7 @@ void iceland_start_smc(struct amdgpu_device *adev)<br>
> WREG32_SMC(ixSMC_SYSCON_RESET_<wbr>CNTL, val);<br>
> }<br>
><br>
> -void iceland_reset_smc(struct amdgpu_device *adev)<br>
> +static void iceland_reset_smc(struct amdgpu_device *adev)<br>
> {<br>
> uint32_t val = RREG32_SMC(ixSMC_SYSCON_RESET_<wbr>CNTL);<br>
><br>
> @@ -145,7 +145,7 @@ static int iceland_program_jump_on_start(<wbr>struct amdgpu_device *adev)<br>
> return 0;<br>
> }<br>
><br>
> -void iceland_stop_smc_clock(struct amdgpu_device *adev)<br>
> +static void iceland_stop_smc_clock(struct amdgpu_device *adev)<br>
> {<br>
> uint32_t val = RREG32_SMC(ixSMC_SYSCON_CLOCK_<wbr>CNTL_0);<br>
><br>
> @@ -153,7 +153,7 @@ void iceland_stop_smc_clock(struct amdgpu_device *adev)<br>
> WREG32_SMC(ixSMC_SYSCON_CLOCK_<wbr>CNTL_0, val);<br>
> }<br>
><br>
> -void iceland_start_smc_clock(struct amdgpu_device *adev)<br>
> +static void iceland_start_smc_clock(struct amdgpu_device *adev)<br>
> {<br>
> uint32_t val = RREG32_SMC(ixSMC_SYSCON_CLOCK_<wbr>CNTL_0);<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>