[radeon-alex:vega20_psp_smu 28/44] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1200:2: note: in expansion of macro 'do_div'

kbuild test robot lkp at intel.com
Wed Aug 15 04:35:10 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git vega20_psp_smu
head:   9b9ef18df4349dd2d2b8941e76c032ed8acf2529
commit: 27480799ed68e17e8228372a4afac7d5dcfbf01a [28/44] drm/amd/powerplay: new interfaces for overdrive vega20 sclk and mclk
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 27480799ed68e17e8228372a4afac7d5dcfbf01a
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm 

All warnings (new ones prefixed by >>):

   In file included from arch/arm/include/asm/div64.h:127:0,
                    from include/linux/kernel.h:174,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c: In function 'vega20_set_sclk_od':
   include/asm-generic/div64.h:222:28: warning: comparison of distinct pointer types lacks a cast
     (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                               ^
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1200:2: note: in expansion of macro 'do_div'
     do_div(od_sclk, 100);
     ^~~~~~
   In file included from include/linux/kernel.h:10:0,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   include/asm-generic/div64.h:235:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     } else if (likely(((n) >> 32) == 0)) {  \
                            ^
   include/linux/compiler.h:76:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1200:2: note: in expansion of macro 'do_div'
     do_div(od_sclk, 100);
     ^~~~~~
   In file included from arch/arm/include/asm/div64.h:127:0,
                    from include/linux/kernel.h:174,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   include/asm-generic/div64.h:239:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
      __rem = __div64_32(&(n), __base); \
                         ^
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1200:2: note: in expansion of macro 'do_div'
     do_div(od_sclk, 100);
     ^~~~~~
   In file included from include/linux/kernel.h:174:0,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   arch/arm/include/asm/div64.h:33:24: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'uint32_t * {aka unsigned int *}'
    static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
                           ^~~~~~~~~~
   In file included from arch/arm/include/asm/div64.h:127:0,
                    from include/linux/kernel.h:174,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c: In function 'vega20_set_mclk_od':
   include/asm-generic/div64.h:222:28: warning: comparison of distinct pointer types lacks a cast
     (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                               ^
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1247:2: note: in expansion of macro 'do_div'
     do_div(od_mclk, 100);
     ^~~~~~
   In file included from include/linux/kernel.h:10:0,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   include/asm-generic/div64.h:235:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     } else if (likely(((n) >> 32) == 0)) {  \
                            ^
   include/linux/compiler.h:76:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1247:2: note: in expansion of macro 'do_div'
     do_div(od_mclk, 100);
     ^~~~~~
   In file included from arch/arm/include/asm/div64.h:127:0,
                    from include/linux/kernel.h:174,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   include/asm-generic/div64.h:239:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
      __rem = __div64_32(&(n), __base); \
                         ^
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:1247:2: note: in expansion of macro 'do_div'
     do_div(od_mclk, 100);
     ^~~~~~
   In file included from include/linux/kernel.h:174:0,
                    from include/linux/delay.h:22,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c:24:
   arch/arm/include/asm/div64.h:33:24: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'uint32_t * {aka unsigned int *}'
    static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
                           ^~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/do_div +1200 drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega20_hwmgr.c

  1187	
  1188	static int vega20_set_sclk_od(
  1189			struct pp_hwmgr *hwmgr, uint32_t value)
  1190	{
  1191		struct vega20_hwmgr *data = hwmgr->backend;
  1192		struct vega20_single_dpm_table *sclk_table =
  1193				&(data->dpm_table.gfx_table);
  1194		struct vega20_single_dpm_table *golden_sclk_table =
  1195				&(data->golden_dpm_table.gfx_table);
  1196		uint32_t od_sclk;
  1197		int ret = 0;
  1198	
  1199		od_sclk = golden_sclk_table->dpm_levels[golden_sclk_table->count - 1].value * value;
> 1200		do_div(od_sclk, 100);
  1201		od_sclk += golden_sclk_table->dpm_levels[golden_sclk_table->count - 1].value;
  1202	
  1203		ret = vega20_od8_set_settings(hwmgr, OD8_SETTING_GFXCLK_FMAX, od_sclk);
  1204		PP_ASSERT_WITH_CODE(!ret,
  1205				"[SetSclkOD] failed to set od gfxclk!",
  1206				return ret);
  1207	
  1208		/* refresh gfxclk table */
  1209		ret = vega20_setup_single_dpm_table(hwmgr, sclk_table, PPCLK_GFXCLK);
  1210		PP_ASSERT_WITH_CODE(!ret,
  1211				"[SetSclkOD] failed to refresh gfxclk table!",
  1212				return ret);
  1213	
  1214		return 0;
  1215	}
  1216	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 66141 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180815/6500e181/attachment-0001.gz>


More information about the dri-devel mailing list