[radeon-alex:amd-staging-drm-next 1046/1062] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c:43:2: note: in expansion of macro 'if'

kbuild test robot fengguang.wu at intel.com
Wed Mar 28 21:35:17 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   6761ccd944db730dca6f9033781b4645a6eecfd4
commit: 8e62ef009a4bb61d25d391d0384f3314cc6d2059 [1046/1062] drm/amd/pp: Use atombios api directly in powerplay
config: i386-randconfig-s1-201812 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        git checkout 8e62ef009a4bb61d25d391d0384f3314cc6d2059
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:6:0,
                    from include/linux/seq_file.h:6,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/hwmgr.h:26,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.h:27,
                    from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c:24:
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c: In function 'pp_atomfwctrl_lookup_voltage_type_v4':
   include/linux/compiler.h:58:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
     ^
   include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c:43:2: note: in expansion of macro 'if'
     if (voltage_type == voltage_object->gpio_voltage_obj.header.voltage_type &&
     ^~
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c:47:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      offset += le16_to_cpu(voltage_object->gpio_voltage_obj.header.object_size);
      ^~~~~~

vim +/if +43 drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c

0d2c7569e Eric Huang 2017-03-03 @24  #include "ppatomfwctrl.h"
0d2c7569e Eric Huang 2017-03-03  25  #include "atomfirmware.h"
8e62ef009 Rex Zhu    2018-03-26  26  #include "atom.h"
0d2c7569e Eric Huang 2017-03-03  27  #include "pp_debug.h"
0d2c7569e Eric Huang 2017-03-03  28  
0d2c7569e Eric Huang 2017-03-03  29  static const union atom_voltage_object_v4 *pp_atomfwctrl_lookup_voltage_type_v4(
0d2c7569e Eric Huang 2017-03-03  30  		const struct atom_voltage_objects_info_v4_1 *voltage_object_info_table,
0d2c7569e Eric Huang 2017-03-03  31  		uint8_t voltage_type, uint8_t voltage_mode)
0d2c7569e Eric Huang 2017-03-03  32  {
0d2c7569e Eric Huang 2017-03-03  33  	unsigned int size = le16_to_cpu(
0d2c7569e Eric Huang 2017-03-03  34  			voltage_object_info_table->table_header.structuresize);
0d2c7569e Eric Huang 2017-03-03  35  	unsigned int offset =
0d2c7569e Eric Huang 2017-03-03  36  			offsetof(struct atom_voltage_objects_info_v4_1, voltage_object[0]);
0d2c7569e Eric Huang 2017-03-03  37  	unsigned long start = (unsigned long)voltage_object_info_table;
0d2c7569e Eric Huang 2017-03-03  38  
0d2c7569e Eric Huang 2017-03-03  39  	while (offset < size) {
0d2c7569e Eric Huang 2017-03-03  40  		const union atom_voltage_object_v4 *voltage_object =
0d2c7569e Eric Huang 2017-03-03  41  				(const union atom_voltage_object_v4 *)(start + offset);
0d2c7569e Eric Huang 2017-03-03  42  
0d2c7569e Eric Huang 2017-03-03 @43  	if (voltage_type == voltage_object->gpio_voltage_obj.header.voltage_type &&
0d2c7569e Eric Huang 2017-03-03  44  		voltage_mode == voltage_object->gpio_voltage_obj.header.voltage_mode)
0d2c7569e Eric Huang 2017-03-03  45  		return voltage_object;
0d2c7569e Eric Huang 2017-03-03  46  
0d2c7569e Eric Huang 2017-03-03  47  		offset += le16_to_cpu(voltage_object->gpio_voltage_obj.header.object_size);
0d2c7569e Eric Huang 2017-03-03  48  
0d2c7569e Eric Huang 2017-03-03  49  	}
0d2c7569e Eric Huang 2017-03-03  50  
0d2c7569e Eric Huang 2017-03-03  51  	return NULL;
0d2c7569e Eric Huang 2017-03-03  52  }
0d2c7569e Eric Huang 2017-03-03  53  

:::::: The code at line 43 was first introduced by commit
:::::: 0d2c7569e1963f10f418c3f8a1c62b0935aa110f drm/amdgpu: add new atomfirmware based helpers for powerplay

:::::: TO: Eric Huang <JinHuiEric.Huang at amd.com>
:::::: CC: Alex Deucher <alexander.deucher at amd.com>

---
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: 35846 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180329/0e3dc9e0/attachment-0001.gz>


More information about the dri-devel mailing list