[radeon-alex:amd-20.45 2387/2427] drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1284:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute

Chen, Guchun Guchun.Chen at amd.com
Tue Dec 15 06:18:12 UTC 2020


[AMD Public Use]

Hi there,

I will fix this soon. The issue is reported on amd-20.45 branch, which was branched out ahead of the fix available on mainline.

Regards,
Guchun

-----Original Message-----
From: kernel test robot <lkp at intel.com> 
Sent: Tuesday, December 15, 2020 1:49 PM
To: Chen, Guchun <Guchun.Chen at amd.com>
Cc: kbuild-all at lists.01.org; clang-built-linux at googlegroups.com; dri-devel at lists.freedesktop.org; Li, Dennis <Dennis.Li at amd.com>
Subject: [radeon-alex:amd-20.45 2387/2427] drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1284:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute

Hi Guchun,

FYI, the error/warning still remains.

tree:   git://people.freedesktop.org/~agd5f/linux.git amd-20.45
head:   a3950d94b046fb206e58fd3ec717f071c0203ba3
commit: cf13e50dea28cde351fa32767e36135afb30386d [2387/2427] drm/amdgpu: clean up ras sysfs creation (v2)
config: x86_64-randconfig-a002-20201214 (attached as .config)
compiler: clang version 12.0.0 (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-project&data=04%7C01%7Cguchun.chen%40amd.com%7C708cce12ecaa4d2ee1d108d8a0bd3135%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637436084052882308%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=I4ohtcRRR8iQs%2FfkMhy%2B7pnsAJ4V%2Br%2F0EpNjcoQp%2B4s%3D&reserved=0 a29ecca7819a6ed4250d3689b12b1f664bb790d7)
reproduce (this is a W=1 build):
        wget https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.cross&data=04%7C01%7Cguchun.chen%40amd.com%7C708cce12ecaa4d2ee1d108d8a0bd3135%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637436084052892302%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ijbznpvhsb43YLeQJ6UZb%2BfG4mnCiAA2ZmPQhLgz6Ig%3D&reserved=0 -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
        git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
        git fetch --no-tags radeon-alex amd-20.45
        git checkout cf13e50dea28cde351fa32767e36135afb30386d
        # 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 at intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:906:5: warning: no previous prototype for function 'amdgpu_ras_error_cure' [-Wmissing-prototypes]
   int amdgpu_ras_error_cure(struct amdgpu_device *adev,
       ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:906:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int amdgpu_ras_error_cure(struct amdgpu_device *adev,
   ^
   static 
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1284:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
           sysfs_create_group(&adev->dev->kobj, &group);
           ^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
   2 warnings generated.

vim +/warn_unused_result +1284 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

  1249	
  1250	/* ras fs */
  1251	static BIN_ATTR(gpu_vram_bad_pages, S_IRUGO,
  1252			amdgpu_ras_sysfs_badpages_read, NULL, 0);
  1253	static DEVICE_ATTR(features, S_IRUGO,
  1254			amdgpu_ras_sysfs_features_read, NULL);
  1255	static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
  1256	{
  1257		struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
  1258		struct attribute_group group = {
  1259			.name = RAS_FS_NAME,
  1260		};
  1261		struct attribute *attrs[] = {
  1262			&con->features_attr.attr,
  1263			NULL
  1264		};
  1265		struct bin_attribute *bin_attrs[] = {
  1266			NULL,
  1267			NULL,
  1268		};
  1269	
  1270		/* add features entry */
  1271		con->features_attr = dev_attr_features;
  1272		group.attrs = attrs;
  1273		sysfs_attr_init(attrs[0]);
  1274	
  1275		if (amdgpu_bad_page_threshold != 0) {
  1276			/* add bad_page_features entry */
  1277			bin_attr_gpu_vram_bad_pages.private = NULL;
  1278			con->badpages_attr = bin_attr_gpu_vram_bad_pages;
  1279			bin_attrs[0] = &con->badpages_attr;
  1280			group.bin_attrs = bin_attrs;
  1281			sysfs_bin_attr_init(bin_attrs[0]);
  1282		}
  1283	
> 1284		sysfs_create_group(&adev->dev->kobj, &group);
  1285	
  1286		return 0;
  1287	}
  1288	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fhyperkitty%2Flist%2Fkbuild-all%40lists.01.org&data=04%7C01%7Cguchun.chen%40amd.com%7C708cce12ecaa4d2ee1d108d8a0bd3135%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637436084052892302%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3yLWtrUMlcPIY%2BMPElzz0R3JmvxV94d6yb0qKIZgdZM%3D&reserved=0


More information about the dri-devel mailing list