[PATCH] drm/amd/powerplay/fiji: mark symbols static where possible

Christian König christian.koenig at amd.com
Tue Sep 6 08:27:49 UTC 2016


Am 06.09.2016 um 08:16 schrieb Baoyou Xie:
> We get a few warnings when building kernel with W=1:
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/fiji_hwmgr.c:1633:9: warning: no previous prototype
> for 'fiji_get_voltage_index' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/fiji_hwmgr.c:5412:5: warning: no previous prototype
> for 'fiji_check_states_equal' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/fiji_thermal.c:424:5: warning: no previous prototype
> for 'tf_fiji_thermal_setup_fan_table' [-Wmissing-prototypes]
> ....
>
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> So this patch marks these functions with 'static'.
>
> Signed-off-by: Baoyou Xie <baoyou.xie at linaro.org>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c   | 33 +++++++++++++---------
>   drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c |  6 ++--
>   2 files changed, 22 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
> index 120a9e2..a4726c4 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
> @@ -113,7 +113,7 @@ static const uint8_t fiji_clock_stretch_amount_conversion[2][6] =
>   
>   static const unsigned long PhwFiji_Magic = (unsigned long)(PHM_VIslands_Magic);
>   
> -struct fiji_power_state *cast_phw_fiji_power_state(
> +static struct fiji_power_state *cast_phw_fiji_power_state(
>   				  struct pp_hw_power_state *hw_ps)
>   {
>   	PP_ASSERT_WITH_CODE((PhwFiji_Magic == hw_ps->magic),
> @@ -123,7 +123,8 @@ struct fiji_power_state *cast_phw_fiji_power_state(
>   	return (struct fiji_power_state *)hw_ps;
>   }
>   
> -const struct fiji_power_state *cast_const_phw_fiji_power_state(
> +static const struct
> +fiji_power_state *cast_const_phw_fiji_power_state(
>   				 const struct pp_hw_power_state *hw_ps)
>   {
>   	PP_ASSERT_WITH_CODE((PhwFiji_Magic == hw_ps->magic),
> @@ -1630,7 +1631,7 @@ static int fiji_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
>    * @param voltage - voltage to look for
>    * @return 0 on success
>    */
> -uint8_t fiji_get_voltage_index(
> +static uint8_t fiji_get_voltage_index(
>   		struct phm_ppt_v1_voltage_lookup_table *lookup_table, uint16_t voltage)
>   {
>   	uint8_t count = (uint8_t) (lookup_table->count);
> @@ -1694,7 +1695,7 @@ static int fiji_populate_cac_table(struct pp_hwmgr *hwmgr,
>   * @return   always  0
>   */
>   
> -int fiji_populate_smc_voltage_tables(struct pp_hwmgr *hwmgr,
> +static int fiji_populate_smc_voltage_tables(struct pp_hwmgr *hwmgr,
>   		struct SMU73_Discrete_DpmTable *table)
>   {
>   	int result;
> @@ -2305,7 +2306,7 @@ static int fiji_populate_all_memory_levels(struct pp_hwmgr *hwmgr)
>   * @param    mclk        the MCLK value to be used in the decision if MVDD should be high or low.
>   * @param    voltage     the SMC VOLTAGE structure to be populated
>   */
> -int fiji_populate_mvdd_value(struct pp_hwmgr *hwmgr,
> +static int fiji_populate_mvdd_value(struct pp_hwmgr *hwmgr,
>   		uint32_t mclk, SMIO_Pattern *smio_pat)
>   {
>   	const struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend);
> @@ -4626,7 +4627,7 @@ static int fiji_generate_dpm_level_enable_mask(
>   	return 0;
>   }
>   
> -int fiji_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
> +static int fiji_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
>   {
>   	return smum_send_msg_to_smc(hwmgr->smumgr, enable ?
>   				  (PPSMC_Msg)PPSMC_MSG_UVDDPM_Enable :
> @@ -4640,14 +4641,14 @@ int fiji_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable)
>   			PPSMC_MSG_VCEDPM_Disable);
>   }
>   
> -int fiji_enable_disable_samu_dpm(struct pp_hwmgr *hwmgr, bool enable)
> +static int fiji_enable_disable_samu_dpm(struct pp_hwmgr *hwmgr, bool enable)
>   {
>   	return smum_send_msg_to_smc(hwmgr->smumgr, enable?
>   			PPSMC_MSG_SAMUDPM_Enable :
>   			PPSMC_MSG_SAMUDPM_Disable);
>   }
>   
> -int fiji_enable_disable_acp_dpm(struct pp_hwmgr *hwmgr, bool enable)
> +static int fiji_enable_disable_acp_dpm(struct pp_hwmgr *hwmgr, bool enable)
>   {
>   	return smum_send_msg_to_smc(hwmgr->smumgr, enable?
>   			PPSMC_MSG_ACPDPM_Enable :
> @@ -4884,7 +4885,7 @@ static void fiji_apply_dal_minimum_voltage_request(struct pp_hwmgr *hwmgr)
>   	return;
>   }
>   
> -int fiji_upload_dpm_level_enable_mask(struct pp_hwmgr *hwmgr)
> +static int fiji_upload_dpm_level_enable_mask(struct pp_hwmgr *hwmgr)
>   {
>   	int result;
>   	struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend);
> @@ -5160,7 +5161,7 @@ static int fiji_program_display_gap(struct pp_hwmgr *hwmgr)
>   	return 0;
>   }
>   
> -int fiji_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
> +static int fiji_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
>   {
>   	return fiji_program_display_gap(hwmgr);
>   }
> @@ -5191,7 +5192,7 @@ static int fiji_set_max_fan_rpm_output(struct pp_hwmgr *hwmgr,
>   			PPSMC_MSG_SetFanRpmMax, us_max_fan_rpm);
>   }
>   
> -int fiji_dpm_set_interrupt_state(void *private_data,
> +static int fiji_dpm_set_interrupt_state(void *private_data,
>   					 unsigned src_id, unsigned type,
>   					 int enabled)
>   {
> @@ -5239,7 +5240,7 @@ int fiji_dpm_set_interrupt_state(void *private_data,
>   	return 0;
>   }
>   
> -int fiji_register_internal_thermal_interrupt(struct pp_hwmgr *hwmgr,
> +static int fiji_register_internal_thermal_interrupt(struct pp_hwmgr *hwmgr,
>   					const void *thermal_interrupt_info)
>   {
>   	int result;
> @@ -5409,7 +5410,10 @@ static inline bool fiji_are_power_levels_equal(const struct fiji_performance_lev
>   		  (pl1->pcie_lane == pl2->pcie_lane));
>   }
>   
> -int fiji_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pstate1, const struct pp_hw_power_state *pstate2, bool *equal)
> +static int
> +fiji_check_states_equal(struct pp_hwmgr *hwmgr,
> +		const struct pp_hw_power_state *pstate1,
> +		const struct pp_hw_power_state *pstate2, bool *equal)
>   {
>   	const struct fiji_power_state *psa = cast_const_phw_fiji_power_state(pstate1);
>   	const struct fiji_power_state *psb = cast_const_phw_fiji_power_state(pstate2);
> @@ -5441,7 +5445,8 @@ int fiji_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_sta
>   	return 0;
>   }
>   
> -bool fiji_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr)
> +static bool
> +fiji_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr)
>   {
>   	struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend);
>   	bool is_update_required = false;
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c
> index 92976b6..7f431e7 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c
> @@ -152,7 +152,7 @@ int fiji_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr)
>   	return 0;
>   }
>   
> -int fiji_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
> +static int fiji_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
>   {
>   	int result;
>   
> @@ -421,7 +421,7 @@ int fiji_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr)
>   * @param    Result the last failure code
>   * @return   result from set temperature range routine
>   */
> -int tf_fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr,
> +static int tf_fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr,
>   		void *input, void *output, void *storage, int result)
>   {
>   	struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend);
> @@ -533,7 +533,7 @@ int tf_fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr,
>   * @param    Result the last failure code
>   * @return   result from set temperature range routine
>   */
> -int tf_fiji_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr,
> +static int tf_fiji_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr,
>   		void *input, void *output, void *storage, int result)
>   {
>   /* If the fantable setup has failed we could have disabled




More information about the dri-devel mailing list