linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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'}
@ 2022-02-15 23:48 kernel test robot
  2022-02-16 22:08 ` [PATCH] drm/amdgpu: Fix ARM compilation warning Luben Tuikov
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-02-15 23:48 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: kbuild-all, linux-kernel, Alex Deucher

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] drm/amdgpu: Fix ARM compilation warning
  2022-02-15 23:48 [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'} kernel test robot
@ 2022-02-16 22:08 ` Luben Tuikov
  2022-02-18  6:25   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Luben Tuikov @ 2022-02-16 22:08 UTC (permalink / raw)
  To: amd-gfx
  Cc: Luben Tuikov, Alex Deucher, kbuild-all, linux-kernel, kernel test robot

Fix this ARM warning:

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=]

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: kbuild-all@lists.01.org
Cc: linux-kernel@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 7e60fbfbdc10a0 ("drm/amdgpu: Show IP discovery in sysfs")
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index ad2355b0037f52..6c3a3c74e0231f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -668,7 +668,7 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev,
 			    le16_to_cpu(ip->hw_id) != ii)
 				goto next_ip;
 
-			DRM_DEBUG("match:%d @ ip_offset:%ld", ii, ip_offset);
+			DRM_DEBUG("match:%d @ ip_offset:%zu", ii, ip_offset);
 
 			/* We have a hw_id match; register the hw
 			 * block if not yet registered.

base-commit: f723076ae13011a23d9a586899e38bc68feeb6b2
-- 
2.35.1.129.gb80121027d


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: Fix ARM compilation warning
  2022-02-16 22:08 ` [PATCH] drm/amdgpu: Fix ARM compilation warning Luben Tuikov
@ 2022-02-18  6:25   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2022-02-18  6:25 UTC (permalink / raw)
  To: Luben Tuikov, amd-gfx
  Cc: Alex Deucher, kbuild-all, linux-kernel, kernel test robot

Also seen on i386.

On 2/16/22 14:08, Luben Tuikov wrote:
> Fix this ARM warning:
> 
> 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=]
> 
> Cc: Alex Deucher <Alexander.Deucher@amd.com>
> Cc: kbuild-all@lists.01.org
> Cc: linux-kernel@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 7e60fbfbdc10a0 ("drm/amdgpu: Show IP discovery in sysfs")
> Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index ad2355b0037f52..6c3a3c74e0231f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -668,7 +668,7 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev,
>  			    le16_to_cpu(ip->hw_id) != ii)
>  				goto next_ip;
>  
> -			DRM_DEBUG("match:%d @ ip_offset:%ld", ii, ip_offset);
> +			DRM_DEBUG("match:%d @ ip_offset:%zu", ii, ip_offset);
>  
>  			/* We have a hw_id match; register the hw
>  			 * block if not yet registered.
> 
> base-commit: f723076ae13011a23d9a586899e38bc68feeb6b2

thanks.
-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-18  6:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 23:48 [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'} kernel test robot
2022-02-16 22:08 ` [PATCH] drm/amdgpu: Fix ARM compilation warning Luben Tuikov
2022-02-18  6:25   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).