From patchwork Mon Sep 19 07:28:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 76509 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp824209qgf; Mon, 19 Sep 2016 00:29:08 -0700 (PDT) X-Received: by 10.66.188.202 with SMTP id gc10mr32306902pac.104.1474270148211; Mon, 19 Sep 2016 00:29:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b77si27077965pfb.196.2016.09.19.00.29.07; Mon, 19 Sep 2016 00:29:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932225AbcISH27 (ORCPT + 27 others); Mon, 19 Sep 2016 03:28:59 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35163 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934453AbcISH2y (ORCPT ); Mon, 19 Sep 2016 03:28:54 -0400 Received: by mail-pf0-f175.google.com with SMTP id z123so48068419pfz.2 for ; Mon, 19 Sep 2016 00:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=1tKRf6c+snduiivf018/EyHilxWr8toLPAThkGliVis=; b=U1tazyfgy/cND2L+tZFwh+oKaxLLu5TWS9sh7gpFVZE0VRnHmdMRtU6BSXkt6MMlVl BLeMPFTrf0X2Cb5Fu4YDG+qmBXUgztJ/9Spbk0qTBeBYTkN3qV8FD81oPAHmQILn/gWD 8wIbHoqDuxPL8T38YTuJQJ7zs9YO5jCjljwqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=1tKRf6c+snduiivf018/EyHilxWr8toLPAThkGliVis=; b=EIGv87DQMfRLeYvVh7QRTUL+MfRvzvhlKu/PmPyueqXN6GVaIh1FHxdZRzrv4/F7jl Sj46OpkOLZCRu069jroQHBmz3rNQbmsPAGeOmT6wDfvfMixm/KKboy0qBCziaJ6DA81v rotqRT0pczIYiNW5adhfytwNv9QniBG7jmvMvGtxCv1UoVJSkzv+o0VviMn94IquidRO c+mqcmZCXUmFeZQD3DkZ3mVUIbYFN1LwZVxBerMWguNe5gESDs7k8AqPzb2LyOoXHX4M 2ZgJi8iRQu8VKaRUo2RSe0kY6Js76rpHk3+u6kuZarG2SDEBu83DRAtHmG/BWR2tjd2l hnFA== X-Gm-Message-State: AE9vXwN7sbWgly9gk75b4kV1+AcMZS0I7jWL93jvehzW1MMkGLsg4MRvICNxccW2jqkzISkt X-Received: by 10.98.28.146 with SMTP id c140mr40222616pfc.158.1474270133341; Mon, 19 Sep 2016 00:28:53 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.244]) by smtp.gmail.com with ESMTPSA id l128sm68856892pfl.21.2016.09.19.00.28.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Sep 2016 00:28:52 -0700 (PDT) From: Baoyou Xie To: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@linux.ie, Qingqing.Wang@amd.com, Monk.Liu@amd.com, JinHuiEric.Huang@amd.com, Rex.Zhu@amd.com, nils.wallmenius@gmail.com, ray.huang@amd.com, Young.Yang@amd.com, Flora.Cui@amd.com, Jammy.Zhou@amd.com, funfunctor@folklore1984.net, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, arnd@arndb.de, baoyou.xie@linaro.org, xie.baoyou@zte.com.cn Subject: [PATCH] drm/amd/powerplay/smumgr: mark symbols static where possible Date: Mon, 19 Sep 2016 15:28:39 +0800 Message-Id: <1474270119-8500-1-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get a few warnings when building kernel with W=1: drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:146:5: warning: no previous prototype for 'tonga_program_jump_on_start' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smumgr.c:816:5: warning: no previous prototype for 'fiji_save_vft_table' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c:743:5: warning: no previous prototype for 'polaris10_avfs_event_mgr' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/iceland_smumgr.c:167:5: warning: no previous prototype for 'iceland_program_jump_on_start' [-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 --- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 22 +++++++++++----------- .../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 2 +- .../drm/amd/powerplay/smumgr/polaris10_smumgr.c | 20 +++++++++++++------- .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 2 +- 4 files changed, 26 insertions(+), 20 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c index 8e52a2e..96fc38e 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c @@ -187,7 +187,7 @@ int fiji_copy_bytes_to_smc(struct pp_smumgr *smumgr, return 0; } -int fiji_program_jump_on_start(struct pp_smumgr *smumgr) +static int fiji_program_jump_on_start(struct pp_smumgr *smumgr) { static const unsigned char data[] = { 0xE0, 0x00, 0x80, 0x40 }; @@ -201,7 +201,7 @@ int fiji_program_jump_on_start(struct pp_smumgr *smumgr) * * @param smumgr the address of the powerplay hardware manager. */ -bool fiji_is_smc_ram_running(struct pp_smumgr *smumgr) +static bool fiji_is_smc_ram_running(struct pp_smumgr *smumgr) { return ((0 == SMUM_READ_VFPF_INDIRECT_FIELD(smumgr->device, CGS_IND_REG__SMC, @@ -217,7 +217,7 @@ bool fiji_is_smc_ram_running(struct pp_smumgr *smumgr) * @param msg the message to send. * @return The response that came from the SMC. */ -int fiji_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg) +static int fiji_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg) { if (!fiji_is_smc_ram_running(smumgr)) return -1; @@ -240,7 +240,7 @@ int fiji_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg) * @param parameter: the parameter to send * @return The response that came from the SMC. */ -int fiji_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr, +static int fiji_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr, uint16_t msg, uint32_t parameter) { if (!fiji_is_smc_ram_running(smumgr)) @@ -267,7 +267,7 @@ int fiji_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr, * @param parameter: the parameter to send * @return The response that came from the SMC. */ -int fiji_send_msg_to_smc_with_parameter_without_waiting( +static int fiji_send_msg_to_smc_with_parameter_without_waiting( struct pp_smumgr *smumgr, uint16_t msg, uint32_t parameter) { if (1 != SMUM_READ_FIELD(smumgr->device, SMC_RESP_0, SMC_RESP)) { @@ -661,7 +661,7 @@ static int fiji_start_smu_in_non_protection_mode(struct pp_smumgr *smumgr) return result; } -int fiji_setup_pwr_virus(struct pp_smumgr *smumgr) +static int fiji_setup_pwr_virus(struct pp_smumgr *smumgr) { int i, result = -1; uint32_t reg, data; @@ -726,7 +726,7 @@ static int fiji_start_avfs_btc(struct pp_smumgr *smumgr) return result; } -int fiji_setup_pm_fuse_for_avfs(struct pp_smumgr *smumgr) +static int fiji_setup_pm_fuse_for_avfs(struct pp_smumgr *smumgr) { int result = 0; uint32_t table_start; @@ -762,7 +762,7 @@ int fiji_setup_pm_fuse_for_avfs(struct pp_smumgr *smumgr) return result; } -int fiji_setup_graphics_level_structure(struct pp_smumgr *smumgr) +static int fiji_setup_graphics_level_structure(struct pp_smumgr *smumgr) { int32_t vr_config; uint32_t table_start; @@ -801,7 +801,7 @@ int fiji_setup_graphics_level_structure(struct pp_smumgr *smumgr) } /* Work in Progress */ -int fiji_restore_vft_table(struct pp_smumgr *smumgr) +static int fiji_restore_vft_table(struct pp_smumgr *smumgr) { struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend); @@ -813,7 +813,7 @@ int fiji_restore_vft_table(struct pp_smumgr *smumgr) } /* Work in Progress */ -int fiji_save_vft_table(struct pp_smumgr *smumgr) +static int fiji_save_vft_table(struct pp_smumgr *smumgr) { struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend); @@ -824,7 +824,7 @@ int fiji_save_vft_table(struct pp_smumgr *smumgr) return -EINVAL; } -int fiji_avfs_event_mgr(struct pp_smumgr *smumgr, bool smu_started) +static int fiji_avfs_event_mgr(struct pp_smumgr *smumgr, bool smu_started) { struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend); diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c index f506583..e5a2b0c 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c @@ -164,7 +164,7 @@ static void iceland_pp_reset_smc(struct pp_smumgr *smumgr) rst_reg, 1); } -int iceland_program_jump_on_start(struct pp_smumgr *smumgr) +static int iceland_program_jump_on_start(struct pp_smumgr *smumgr) { static const unsigned char pData[] = { 0xE0, 0x00, 0x80, 0x40 }; diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c index 704ff4c..e7f7b68 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c @@ -212,7 +212,7 @@ static int polaris10_program_jump_on_start(struct pp_smumgr *smumgr) * * @param smumgr the address of the powerplay hardware manager. */ -bool polaris10_is_smc_ram_running(struct pp_smumgr *smumgr) +static bool polaris10_is_smc_ram_running(struct pp_smumgr *smumgr) { return ((0 == SMUM_READ_VFPF_INDIRECT_FIELD(smumgr->device, CGS_IND_REG__SMC, SMC_SYSCON_CLOCK_CNTL_0, ck_disable)) && (0x20100 <= cgs_read_ind_register(smumgr->device, CGS_IND_REG__SMC, ixSMC_PC_C))); @@ -237,7 +237,8 @@ static bool polaris10_is_hw_avfs_present(struct pp_smumgr *smumgr) * @param msg the message to send. * @return The response that came from the SMC. */ -int polaris10_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg) +static int +polaris10_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg) { int ret; @@ -272,7 +273,9 @@ int polaris10_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg) * @param msg the message to send. * @return Always return 0. */ -int polaris10_send_msg_to_smc_without_waiting(struct pp_smumgr *smumgr, uint16_t msg) +static int +polaris10_send_msg_to_smc_without_waiting(struct pp_smumgr *smumgr, + uint16_t msg) { cgs_write_register(smumgr->device, mmSMC_MESSAGE_0, msg); @@ -287,7 +290,9 @@ int polaris10_send_msg_to_smc_without_waiting(struct pp_smumgr *smumgr, uint16_t * @param parameter: the parameter to send * @return The response that came from the SMC. */ -int polaris10_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr, uint16_t msg, uint32_t parameter) +static int +polaris10_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr, + uint16_t msg, uint32_t parameter) { if (!polaris10_is_smc_ram_running(smumgr)) { return -1; @@ -316,7 +321,7 @@ int polaris10_send_msg_to_smc_with_parameter_without_waiting(struct pp_smumgr *s return polaris10_send_msg_to_smc_without_waiting(smumgr, msg); } -int polaris10_send_msg_to_smc_offset(struct pp_smumgr *smumgr) +static int polaris10_send_msg_to_smc_offset(struct pp_smumgr *smumgr) { cgs_write_register(smumgr->device, mmSMC_MSG_ARG_0, 0x20000); @@ -686,7 +691,7 @@ static int polaris10_perform_btc(struct pp_smumgr *smumgr) } -int polaris10_setup_graphics_level_structure(struct pp_smumgr *smumgr) +static int polaris10_setup_graphics_level_structure(struct pp_smumgr *smumgr) { uint32_t vr_config; uint32_t dpm_table_start; @@ -740,7 +745,8 @@ int polaris10_setup_graphics_level_structure(struct pp_smumgr *smumgr) return 0; } -int polaris10_avfs_event_mgr(struct pp_smumgr *smumgr, bool SMU_VFT_INTACT) +static int +polaris10_avfs_event_mgr(struct pp_smumgr *smumgr, bool SMU_VFT_INTACT) { struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(smumgr->backend); diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c index f42c536..2efdd98 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c @@ -143,7 +143,7 @@ out: } -int tonga_program_jump_on_start(struct pp_smumgr *smumgr) +static int tonga_program_jump_on_start(struct pp_smumgr *smumgr) { static const unsigned char pData[] = { 0xE0, 0x00, 0x80, 0x40 };