lkml.org 
[lkml]   [2022]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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'}
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/archive/20220216/202202160733.1Egjqp9Y-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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 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=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/

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

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_discovery_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=]
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 string is defined here
664 | DRM_DEBUG("match:%d @ ip_offset:%ld", ii, ip_offset);
| ~~^
| |
| long int
| %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/<attributes>
650 */
651 for (ii = 0; ii < HW_ID_MAX; ii++) {
652 struct ip_hw_id *ip_hw_id = NULL;
653 size_t ip_offset = _ip_offset;
654
655 for (jj = 0; jj < num_ips; jj++) {
656 struct ip *ip;
657 struct ip_hw_instance *ip_hw_instance;
658
659 ip = (struct ip *)(adev->mman.discovery_bin + ip_offset);
660 if (amdgpu_discovery_validate_ip(ip) ||
661 le16_to_cpu(ip->hw_id) != 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 = kzalloc(sizeof(*ip_hw_id), GFP_KERNEL);
671 if (!ip_hw_id)
672 return -ENOMEM;
673 ip_hw_id->hw_id = ii;
674
675 kobject_set_name(&ip_hw_id->hw_id_kset.kobj, "%d", ii);
676 ip_hw_id->hw_id_kset.kobj.kset = &ip_die_entry->ip_kset;
677 ip_hw_id->hw_id_kset.kobj.ktype = &ip_hw_id_ktype;
678 res = 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 = 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 = 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 = le16_to_cpu(ip->hw_id); /* == ii */
707 ip_hw_instance->num_instance = ip->number_instance;
708 ip_hw_instance->major = ip->major;
709 ip_hw_instance->minor = ip->minor;
710 ip_hw_instance->revision = ip->revision;
711 ip_hw_instance->num_base_addresses = ip->num_base_address;
712
713 for (kk = 0; kk < ip_hw_instance->num_base_addresses; kk++)
714 ip_hw_instance->base_addr[kk] = ip->base_address[kk];
715
716 kobject_init(&ip_hw_instance->kobj, &ip_hw_instance_ktype);
717 ip_hw_instance->kobj.kset = &ip_hw_id->hw_id_kset;
718 res = kobject_add(&ip_hw_instance->kobj, NULL,
719 "%d", ip_hw_instance->num_instance);
720 next_ip:
721 ip_offset += 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@lists.01.org

\
 
 \ /
  Last update: 2022-02-16 00:50    [W:0.046 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site