Content-Type: multipart/mixed; boundary="===============1351219141149466208==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [agd5f:drm-next 2/34] drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:664:35: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} Date: Wed, 16 Feb 2022 07:48:56 +0800 Message-ID: <202202160733.1Egjqp9Y-lkp@intel.com> List-Id: --===============1351219141149466208== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next head: 076172cdc7ab4983ed7596a53b95851849269e5a commit: a6c40b178092f41b9d6cc8615697c14b1e5a1c3a [2/34] drm/amdgpu: Show IP= discovery in sysfs config: arm-randconfig-r005-20220214 (https://download.01.org/0day-ci/archi= ve/20220216/202202160733.1Egjqp9Y-lkp(a)intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git git fetch --no-tags agd5f drm-next git checkout a6c40b178092f41b9d6cc8615697c14b1e5a1c3a # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Darm SHELL=3D/bin/bash drivers/gpu/drm/amd/amdgpu/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h:29, from drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h:26, from drivers/gpu/drm/amd/amdgpu/amdgpu.h:43, from drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:26: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c: In function 'amdgpu_disco= very_sysfs_ips': >> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:664:35: warning: format '%= ld' expects argument of type 'long int', but argument 4 has type 'size_t' {= aka 'unsigned int'} [-Wformat=3D] 664 | DRM_DEBUG("match:%d @ ip_offset:%ld", ii= , ip_offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ = ~~~~~~~~~ | = | | = size_t {aka unsigned int} include/drm/drm_print.h:526:32: note: in definition of macro 'DRM_DEBUG' 526 | __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) | ^~~ drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:664:59: note: format strin= g is defined here 664 | DRM_DEBUG("match:%d @ ip_offset:%ld", ii= , ip_offset); | ~~^ | | | long i= nt | %d vim +664 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c 639 = 640 static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev, 641 struct ip_die_entry *ip_die_entry, 642 const size_t _ip_offset, const int num_ips) 643 { 644 int ii, jj, kk, res; 645 = 646 DRM_DEBUG("num_ips:%d", num_ips); 647 = 648 /* Find all IPs of a given HW ID, and add their instance to 649 * #die/#hw_id/#instance/ 650 */ 651 for (ii =3D 0; ii < HW_ID_MAX; ii++) { 652 struct ip_hw_id *ip_hw_id =3D NULL; 653 size_t ip_offset =3D _ip_offset; 654 = 655 for (jj =3D 0; jj < num_ips; jj++) { 656 struct ip *ip; 657 struct ip_hw_instance *ip_hw_instance; 658 = 659 ip =3D (struct ip *)(adev->mman.discovery_bin + ip_offset); 660 if (amdgpu_discovery_validate_ip(ip) || 661 le16_to_cpu(ip->hw_id) !=3D ii) 662 goto next_ip; 663 = > 664 DRM_DEBUG("match:%d @ ip_offset:%ld", ii, ip_offset); 665 = 666 /* We have a hw_id match; register the hw 667 * block if not yet registered. 668 */ 669 if (!ip_hw_id) { 670 ip_hw_id =3D kzalloc(sizeof(*ip_hw_id), GFP_KERNEL); 671 if (!ip_hw_id) 672 return -ENOMEM; 673 ip_hw_id->hw_id =3D ii; 674 = 675 kobject_set_name(&ip_hw_id->hw_id_kset.kobj, "%d", ii); 676 ip_hw_id->hw_id_kset.kobj.kset =3D &ip_die_entry->ip_kset; 677 ip_hw_id->hw_id_kset.kobj.ktype =3D &ip_hw_id_ktype; 678 res =3D kset_register(&ip_hw_id->hw_id_kset); 679 if (res) { 680 DRM_ERROR("Couldn't register ip_hw_id kset"); 681 kfree(ip_hw_id); 682 return res; 683 } 684 if (hw_id_names[ii]) { 685 res =3D sysfs_create_link(&ip_die_entry->ip_kset.kobj, 686 &ip_hw_id->hw_id_kset.kobj, 687 hw_id_names[ii]); 688 if (res) { 689 DRM_ERROR("Couldn't create IP link %s in IP Die:%s\n", 690 hw_id_names[ii], 691 kobject_name(&ip_die_entry->ip_kset.kobj)); 692 } 693 } 694 } 695 = 696 /* Now register its instance. 697 */ 698 ip_hw_instance =3D kzalloc(struct_size(ip_hw_instance, 699 base_addr, 700 ip->num_base_address), 701 GFP_KERNEL); 702 if (!ip_hw_instance) { 703 DRM_ERROR("no memory for ip_hw_instance"); 704 return -ENOMEM; 705 } 706 ip_hw_instance->hw_id =3D le16_to_cpu(ip->hw_id); /* =3D=3D ii */ 707 ip_hw_instance->num_instance =3D ip->number_instance; 708 ip_hw_instance->major =3D ip->major; 709 ip_hw_instance->minor =3D ip->minor; 710 ip_hw_instance->revision =3D ip->revision; 711 ip_hw_instance->num_base_addresses =3D ip->num_base_address; 712 = 713 for (kk =3D 0; kk < ip_hw_instance->num_base_addresses; kk++) 714 ip_hw_instance->base_addr[kk] =3D ip->base_address[kk]; 715 = 716 kobject_init(&ip_hw_instance->kobj, &ip_hw_instance_ktype); 717 ip_hw_instance->kobj.kset =3D &ip_hw_id->hw_id_kset; 718 res =3D kobject_add(&ip_hw_instance->kobj, NULL, 719 "%d", ip_hw_instance->num_instance); 720 next_ip: 721 ip_offset +=3D sizeof(*ip) + 4 * (ip->num_base_address - 1); 722 } 723 } 724 = 725 return 0; 726 } 727 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============1351219141149466208==--