From: "Christian König" <christian.koenig@amd.com>
To: Baoyou Xie <baoyou.xie@linaro.org>, <alexander.deucher@amd.com>,
<airlied@linux.ie>, <JinHuiEric.Huang@amd.com>, <Rex.Zhu@amd.com>,
<nils.wallmenius@gmail.com>, <funfunctor@folklore1984.net>,
<sfr@canb.auug.org.au>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<arnd@arndb.de>, <xie.baoyou@zte.com.cn>
Subject: Re: [PATCH] drm/amd/powerplay/fiji: mark symbols static where possible
Date: Tue, 6 Sep 2016 10:27:49 +0200 [thread overview]
Message-ID: <591bf6f2-d9a1-dc31-82f1-a3ecfd15e6ba@amd.com> (raw)
In-Reply-To: <1473142588-28453-1-git-send-email-baoyou.xie@linaro.org>
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@linaro.org>
Reviewed-by: Christian König <christian.koenig@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
prev parent reply other threads:[~2016-09-06 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 6:16 Baoyou Xie
2016-09-06 8:27 ` Christian König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=591bf6f2-d9a1-dc31-82f1-a3ecfd15e6ba@amd.com \
--to=christian.koenig@amd.com \
--cc=JinHuiEric.Huang@amd.com \
--cc=Rex.Zhu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=arnd@arndb.de \
--cc=baoyou.xie@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=funfunctor@folklore1984.net \
--cc=linux-kernel@vger.kernel.org \
--cc=nils.wallmenius@gmail.com \
--cc=sfr@canb.auug.org.au \
--cc=xie.baoyou@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®