drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:225:10: warning: comparison of unsigned expression < 0 is always false

From: kernel test robot
Date: Wed Jun 17 2020 - 12:40:50 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 69119673bd50b176ded34032fadd41530fb5af21
commit: 80381d40c9bf5218db06a7d7246c5478c95987ee drm/amd/powerplay: fix pre-check condition for setting clock range
date: 3 months ago
config: ia64-randconfig-r003-20200617 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
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
git checkout 80381d40c9bf5218db06a7d7246c5478c95987ee
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/mm.h:94,
from arch/ia64/include/asm/uaccess.h:38,
from include/linux/uaccess.h:11,
from arch/ia64/include/asm/sections.h:11,
from include/linux/interrupt.h:20,
from include/linux/pci.h:38,
from drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:24:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c: In function 'smu_set_soft_freq_range':
>> drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:225:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
225 | if (min < 0 && max < 0)
| ^
drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:225:21: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
225 | if (min < 0 && max < 0)
| ^
drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c: At top level:
drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:1703:5: warning: no previous prototype for 'smu_adjust_power_state_dynamic' [-Wmissing-prototypes]
1703 | int smu_adjust_power_state_dynamic(struct smu_context *smu,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:31:
drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smu_v11_0.h:68:43: warning: 'smu11_thermal_policy' defined but not used [-Wunused-const-variable=]
68 | static const struct smu_temperature_range smu11_thermal_policy[] =
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:27:
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:177:18: warning: 'sched_policy' defined but not used [-Wunused-const-variable=]
177 | static const int sched_policy = KFD_SCHED_POLICY_HWS;
| ^~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:53,
from drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c:27:
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: 'dc_fixpt_ln2_div_2' defined but not used [-Wunused-const-variable=]
76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
| ^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: 'dc_fixpt_ln2' defined but not used [-Wunused-const-variable=]
75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
| ^~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: 'dc_fixpt_e' defined but not used [-Wunused-const-variable=]
74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
| ^~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: 'dc_fixpt_two_pi' defined but not used [-Wunused-const-variable=]
73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: 'dc_fixpt_pi' defined but not used [-Wunused-const-variable=]
72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
| ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:67:32: warning: 'dc_fixpt_zero' defined but not used [-Wunused-const-variable=]
67 | static const struct fixed31_32 dc_fixpt_zero = { 0 };
| ^~~~~~~~~~~~~

vim +225 drivers/gpu/drm/amd/amdgpu/../powerplay/amdgpu_smu.c

219
220 int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
221 uint32_t min, uint32_t max)
222 {
223 int ret = 0;
224
> 225 if (min < 0 && max < 0)
226 return -EINVAL;
227
228 if (!smu_clk_dpm_is_enabled(smu, clk_type))
229 return 0;
230
231 ret = smu_set_soft_freq_limited_range(smu, clk_type, min, max);
232 return ret;
233 }
234

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip