* [PATCH -next] drm/amd/pm: remove unused variable
@ 2020-11-02 12:08 Zou Wei
2020-11-02 17:23 ` kernel test robot
2020-11-02 19:04 ` Alex Deucher
0 siblings, 2 replies; 3+ messages in thread
From: Zou Wei @ 2020-11-02 12:08 UTC (permalink / raw)
To: alexander.deucher, christian.koenig, airlied, daniel
Cc: Xiaojian.Du, amd-gfx, dri-devel, linux-kernel, Zou Wei
Fix variable set but not used compilation warning:
./vangogh_ppt.c:397:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret = 0;
^~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
index 6e26025..355ade5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
@@ -394,8 +394,6 @@ static int vangogh_get_current_activity_percent(struct smu_context *smu,
enum amd_pp_sensors sensor,
uint32_t *value)
{
- int ret = 0;
-
if (!value)
return -EINVAL;
--
2.6.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] drm/amd/pm: remove unused variable
2020-11-02 12:08 [PATCH -next] drm/amd/pm: remove unused variable Zou Wei
@ 2020-11-02 17:23 ` kernel test robot
2020-11-02 19:04 ` Alex Deucher
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-11-02 17:23 UTC (permalink / raw)
To: Zou Wei, alexander.deucher, christian.koenig, airlied, daniel
Cc: kbuild-all, clang-built-linux, Xiaojian.Du, amd-gfx, dri-devel,
linux-kernel, Zou Wei
[-- Attachment #1: Type: text/plain, Size: 3176 bytes --]
Hi Zou,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20201102]
url: https://github.com/0day-ci/linux/commits/Zou-Wei/drm-amd-pm-remove-unused-variable/20201102-195853
base: b49976d8ef6448e86a7fda6a86f64867942b442d
config: x86_64-randconfig-a004-20201102 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cc91554ebb66e8c9a4b8c67ca2f1343eaac10cf6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/4a14c85aff468b2d26c02415991b440b0b56fc75
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zou-Wei/drm-amd-pm-remove-unused-variable/20201102-195853
git checkout 4a14c85aff468b2d26c02415991b440b0b56fc75
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:402:3: error: use of undeclared identifier 'ret'
ret = vangogh_get_smu_metrics_data(smu,
^
1 error generated.
vim +/ret +402 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c
271ab489f755245 Xiaojian Du 2020-10-26 392
271ab489f755245 Xiaojian Du 2020-10-26 393 static int vangogh_get_current_activity_percent(struct smu_context *smu,
271ab489f755245 Xiaojian Du 2020-10-26 394 enum amd_pp_sensors sensor,
271ab489f755245 Xiaojian Du 2020-10-26 395 uint32_t *value)
271ab489f755245 Xiaojian Du 2020-10-26 396 {
271ab489f755245 Xiaojian Du 2020-10-26 397 if (!value)
271ab489f755245 Xiaojian Du 2020-10-26 398 return -EINVAL;
271ab489f755245 Xiaojian Du 2020-10-26 399
271ab489f755245 Xiaojian Du 2020-10-26 400 switch (sensor) {
271ab489f755245 Xiaojian Du 2020-10-26 401 case AMDGPU_PP_SENSOR_GPU_LOAD:
271ab489f755245 Xiaojian Du 2020-10-26 @402 ret = vangogh_get_smu_metrics_data(smu,
271ab489f755245 Xiaojian Du 2020-10-26 403 METRICS_AVERAGE_GFXACTIVITY,
271ab489f755245 Xiaojian Du 2020-10-26 404 value);
271ab489f755245 Xiaojian Du 2020-10-26 405 break;
271ab489f755245 Xiaojian Du 2020-10-26 406 default:
271ab489f755245 Xiaojian Du 2020-10-26 407 dev_err(smu->adev->dev, "Invalid sensor for retrieving clock activity\n");
271ab489f755245 Xiaojian Du 2020-10-26 408 return -EINVAL;
271ab489f755245 Xiaojian Du 2020-10-26 409 }
271ab489f755245 Xiaojian Du 2020-10-26 410
271ab489f755245 Xiaojian Du 2020-10-26 411 return 0;
271ab489f755245 Xiaojian Du 2020-10-26 412 }
271ab489f755245 Xiaojian Du 2020-10-26 413
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37751 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] drm/amd/pm: remove unused variable
2020-11-02 12:08 [PATCH -next] drm/amd/pm: remove unused variable Zou Wei
2020-11-02 17:23 ` kernel test robot
@ 2020-11-02 19:04 ` Alex Deucher
1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-11-02 19:04 UTC (permalink / raw)
To: Zou Wei
Cc: Deucher, Alexander, Christian Koenig, Dave Airlie, Daniel Vetter,
Maling list - DRI developers, amd-gfx list, Xiaojian Du, LKML
On Mon, Nov 2, 2020 at 8:44 AM Zou Wei <zou_wei@huawei.com> wrote:
>
> Fix variable set but not used compilation warning:
>
> ./vangogh_ppt.c:397:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
> int ret = 0;
> ^~~
>
Maybe you have an older version of the code? It's currently used.
Alex
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 6e26025..355ade5 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -394,8 +394,6 @@ static int vangogh_get_current_activity_percent(struct smu_context *smu,
> enum amd_pp_sensors sensor,
> uint32_t *value)
> {
> - int ret = 0;
> -
> if (!value)
> return -EINVAL;
>
> --
> 2.6.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-02 19:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 12:08 [PATCH -next] drm/amd/pm: remove unused variable Zou Wei
2020-11-02 17:23 ` kernel test robot
2020-11-02 19:04 ` Alex Deucher
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®