linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 7361/11453] drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size
@ 2023-08-22  1:14 kernel test robot
  2023-08-22  6:46 ` Karolina Stolarek
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-08-22  1:14 UTC (permalink / raw)
  To: Karolina Stolarek
  Cc: oe-kbuild-all, Linux Memory Management List, Christian König

Hi Karolina,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
commit: 204042049a941d2a9a7d49bdcda768578b5f88ec [7361/11453] drm/ttm/tests: Add tests for ttm_pool
config: arc-randconfig-r011-20230822 (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308220932.nPQdTkIN-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/drm/drm_kunit_helpers.h:6,
                    from drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h:12,
                    from drivers/gpu/drm/ttm/tests/ttm_pool_test.c:10:
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c: In function 'ttm_pool_alloc_basic_dma_addr':
>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
         |                                     ^
   include/kunit/test.h:598:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     598 |         const typeof(left) __left = (left);                                    \
         |                      ^~~~
   include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
    1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
    1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
     231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
         |         ^~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
         |                                     ^
   include/kunit/test.h:598:38: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     598 |         const typeof(left) __left = (left);                                    \
         |                                      ^~~~
   include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
    1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
    1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
     231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
         |         ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
         |                                     ^
   include/kunit/test.h:598:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     598 |         const typeof(left) __left = (left);                                    \
         |                      ^~~~
   include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
    1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
    1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
     232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
         |         ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
         |                                     ^
   include/kunit/test.h:598:38: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     598 |         const typeof(left) __left = (left);                                    \
         |                                      ^~~~
   include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
    1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
    1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
     232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
         |         ^~~~~~~~~~~~~~~~~~~~~


vim +231 drivers/gpu/drm/ttm/tests/ttm_pool_test.c

   195	
   196	static void ttm_pool_alloc_basic_dma_addr(struct kunit *test)
   197	{
   198		struct ttm_pool_test_priv *priv = test->priv;
   199		struct ttm_test_devices *devs = priv->devs;
   200		const struct ttm_pool_test_case *params = test->param_value;
   201		struct ttm_tt *tt;
   202		struct ttm_pool *pool;
   203		struct ttm_buffer_object *bo;
   204		dma_addr_t dma1, dma2;
   205		enum ttm_caching caching = ttm_uncached;
   206		unsigned int expected_num_pages = 1 << params->order;
   207		size_t size = expected_num_pages * PAGE_SIZE;
   208		int err;
   209	
   210		tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
   211		KUNIT_ASSERT_NOT_NULL(test, tt);
   212	
   213		bo = ttm_bo_kunit_init(test, devs, size);
   214		KUNIT_ASSERT_NOT_NULL(test, bo);
   215	
   216		err = ttm_sg_tt_init(tt, bo, 0, caching);
   217		KUNIT_ASSERT_EQ(test, err, 0);
   218	
   219		pool = kunit_kzalloc(test, sizeof(*pool), GFP_KERNEL);
   220		KUNIT_ASSERT_NOT_NULL(test, pool);
   221	
   222		ttm_pool_init(pool, devs->dev, NUMA_NO_NODE, true, false);
   223	
   224		err = ttm_pool_alloc(pool, tt, &simple_ctx);
   225		KUNIT_ASSERT_EQ(test, err, 0);
   226		KUNIT_ASSERT_EQ(test, tt->num_pages, expected_num_pages);
   227	
   228		dma1 = tt->dma_address[0];
   229		dma2 = tt->dma_address[tt->num_pages - 1];
   230	
 > 231		KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
   232		KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
   233	
   234		ttm_pool_free(pool, tt);
   235		ttm_tt_fini(tt);
   236		ttm_pool_fini(pool);
   237	}
   238	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [linux-next:master 7361/11453] drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size
  2023-08-22  1:14 [linux-next:master 7361/11453] drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size kernel test robot
@ 2023-08-22  6:46 ` Karolina Stolarek
  2023-08-22 11:58   ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Karolina Stolarek @ 2023-08-22  6:46 UTC (permalink / raw)
  To: kernel test robot
  Cc: oe-kbuild-all, Linux Memory Management List, Christian König

On 22.08.2023 03:14, kernel test robot wrote:
> Hi Karolina,
> 
> FYI, the error/warning still remains.

I sent a patch to address this warning in 
20230816105508.1135410-1-karolina.stolarek@intel.com but probably got 
lost in the noise and hasn't been reviewed.

Would it be possible to take a look at it?

All the best,
Karolina

> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
> commit: 204042049a941d2a9a7d49bdcda768578b5f88ec [7361/11453] drm/ttm/tests: Add tests for ttm_pool
> config: arc-randconfig-r011-20230822 (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/config)
> compiler: arc-elf-gcc (GCC) 12.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202308220932.nPQdTkIN-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>     In file included from include/drm/drm_kunit_helpers.h:6,
>                      from drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h:12,
>                      from drivers/gpu/drm/ttm/tests/ttm_pool_test.c:10:
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c: In function 'ttm_pool_alloc_basic_dma_addr':
>>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>           |                                     ^
>     include/kunit/test.h:598:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
>       598 |         const typeof(left) __left = (left);                                    \
>           |                      ^~~~
>     include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
>      1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
>      1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>           |         ^~~~~~~~~~~~~~~~~~~~~
>>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>           |                                     ^
>     include/kunit/test.h:598:38: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
>       598 |         const typeof(left) __left = (left);                                    \
>           |                                      ^~~~
>     include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
>      1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
>      1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>           |         ^~~~~~~~~~~~~~~~~~~~~
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>           |                                     ^
>     include/kunit/test.h:598:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
>       598 |         const typeof(left) __left = (left);                                    \
>           |                      ^~~~
>     include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
>      1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
>      1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>           |         ^~~~~~~~~~~~~~~~~~~~~
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>           |                                     ^
>     include/kunit/test.h:598:38: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
>       598 |         const typeof(left) __left = (left);                                    \
>           |                                      ^~~~
>     include/kunit/test.h:1384:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
>      1384 |         KUNIT_BINARY_PTR_ASSERTION(test,                                       \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/kunit/test.h:1379:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL_MSG'
>      1379 |         KUNIT_ASSERT_NOT_NULL_MSG(test,                                        \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>           |         ^~~~~~~~~~~~~~~~~~~~~
> 
> 
> vim +231 drivers/gpu/drm/ttm/tests/ttm_pool_test.c
> 
>     195	
>     196	static void ttm_pool_alloc_basic_dma_addr(struct kunit *test)
>     197	{
>     198		struct ttm_pool_test_priv *priv = test->priv;
>     199		struct ttm_test_devices *devs = priv->devs;
>     200		const struct ttm_pool_test_case *params = test->param_value;
>     201		struct ttm_tt *tt;
>     202		struct ttm_pool *pool;
>     203		struct ttm_buffer_object *bo;
>     204		dma_addr_t dma1, dma2;
>     205		enum ttm_caching caching = ttm_uncached;
>     206		unsigned int expected_num_pages = 1 << params->order;
>     207		size_t size = expected_num_pages * PAGE_SIZE;
>     208		int err;
>     209	
>     210		tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
>     211		KUNIT_ASSERT_NOT_NULL(test, tt);
>     212	
>     213		bo = ttm_bo_kunit_init(test, devs, size);
>     214		KUNIT_ASSERT_NOT_NULL(test, bo);
>     215	
>     216		err = ttm_sg_tt_init(tt, bo, 0, caching);
>     217		KUNIT_ASSERT_EQ(test, err, 0);
>     218	
>     219		pool = kunit_kzalloc(test, sizeof(*pool), GFP_KERNEL);
>     220		KUNIT_ASSERT_NOT_NULL(test, pool);
>     221	
>     222		ttm_pool_init(pool, devs->dev, NUMA_NO_NODE, true, false);
>     223	
>     224		err = ttm_pool_alloc(pool, tt, &simple_ctx);
>     225		KUNIT_ASSERT_EQ(test, err, 0);
>     226		KUNIT_ASSERT_EQ(test, tt->num_pages, expected_num_pages);
>     227	
>     228		dma1 = tt->dma_address[0];
>     229		dma2 = tt->dma_address[tt->num_pages - 1];
>     230	
>   > 231		KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>     232		KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>     233	
>     234		ttm_pool_free(pool, tt);
>     235		ttm_tt_fini(tt);
>     236		ttm_pool_fini(pool);
>     237	}
>     238	
> 


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

* Re: [linux-next:master 7361/11453] drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size
  2023-08-22  6:46 ` Karolina Stolarek
@ 2023-08-22 11:58   ` Christian König
  2023-08-22 12:58     ` Karolina Stolarek
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2023-08-22 11:58 UTC (permalink / raw)
  To: Karolina Stolarek, kernel test robot
  Cc: oe-kbuild-all, Linux Memory Management List

Am 22.08.23 um 08:46 schrieb Karolina Stolarek:
> On 22.08.2023 03:14, kernel test robot wrote:
>> Hi Karolina,
>>
>> FYI, the error/warning still remains.
>
> I sent a patch to address this warning in 
> 20230816105508.1135410-1-karolina.stolarek@intel.com but probably got 
> lost in the noise and hasn't been reviewed.
>
> Would it be possible to take a look at it?

Sorry for the delay. AMD has a new security policy and I now have 
trouble using dim and pushing patches.

Just picked this one up and pushed it to drm-misc-next-fixes.

Regards,
Christian.

>
> All the best,
> Karolina
>
>>
>> tree: 
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
>> master
>> head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
>> commit: 204042049a941d2a9a7d49bdcda768578b5f88ec [7361/11453] 
>> drm/ttm/tests: Add tests for ttm_pool
>> config: arc-randconfig-r011-20230822 
>> (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/config)
>> compiler: arc-elf-gcc (GCC) 12.3.0
>> reproduce: 
>> (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new 
>> version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: 
>> https://lore.kernel.org/oe-kbuild-all/202308220932.nPQdTkIN-lkp@intel.com/
>>
>> All warnings (new ones prefixed by >>):
>>
>>     In file included from include/drm/drm_kunit_helpers.h:6,
>>                      from 
>> drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h:12,
>>                      from drivers/gpu/drm/ttm/tests/ttm_pool_test.c:10:
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c: In function 
>> 'ttm_pool_alloc_basic_dma_addr':
>>>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to 
>>>> pointer from integer of different size [-Wint-to-pointer-cast]
>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>           |                                     ^
>>     include/kunit/test.h:598:22: note: in definition of macro 
>> 'KUNIT_BASE_BINARY_ASSERTION'
>>       598 |         const typeof(left) __left = 
>> (left);                                    \
>>           |                      ^~~~
>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>> 'KUNIT_BINARY_PTR_ASSERTION'
>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in 
>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to 
>>>> pointer from integer of different size [-Wint-to-pointer-cast]
>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>           |                                     ^
>>     include/kunit/test.h:598:38: note: in definition of macro 
>> 'KUNIT_BASE_BINARY_ASSERTION'
>>       598 |         const typeof(left) __left = 
>> (left);                                    \
>>           |                                      ^~~~
>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>> 'KUNIT_BINARY_PTR_ASSERTION'
>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in 
>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast 
>> to pointer from integer of different size [-Wint-to-pointer-cast]
>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>           |                                     ^
>>     include/kunit/test.h:598:22: note: in definition of macro 
>> 'KUNIT_BASE_BINARY_ASSERTION'
>>       598 |         const typeof(left) __left = 
>> (left);                                    \
>>           |                      ^~~~
>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>> 'KUNIT_BINARY_PTR_ASSERTION'
>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in 
>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast 
>> to pointer from integer of different size [-Wint-to-pointer-cast]
>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>           |                                     ^
>>     include/kunit/test.h:598:38: note: in definition of macro 
>> 'KUNIT_BASE_BINARY_ASSERTION'
>>       598 |         const typeof(left) __left = 
>> (left);                                    \
>>           |                                      ^~~~
>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>> 'KUNIT_BINARY_PTR_ASSERTION'
>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in 
>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>
>>
>> vim +231 drivers/gpu/drm/ttm/tests/ttm_pool_test.c
>>
>>     195
>>     196    static void ttm_pool_alloc_basic_dma_addr(struct kunit *test)
>>     197    {
>>     198        struct ttm_pool_test_priv *priv = test->priv;
>>     199        struct ttm_test_devices *devs = priv->devs;
>>     200        const struct ttm_pool_test_case *params = 
>> test->param_value;
>>     201        struct ttm_tt *tt;
>>     202        struct ttm_pool *pool;
>>     203        struct ttm_buffer_object *bo;
>>     204        dma_addr_t dma1, dma2;
>>     205        enum ttm_caching caching = ttm_uncached;
>>     206        unsigned int expected_num_pages = 1 << params->order;
>>     207        size_t size = expected_num_pages * PAGE_SIZE;
>>     208        int err;
>>     209
>>     210        tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
>>     211        KUNIT_ASSERT_NOT_NULL(test, tt);
>>     212
>>     213        bo = ttm_bo_kunit_init(test, devs, size);
>>     214        KUNIT_ASSERT_NOT_NULL(test, bo);
>>     215
>>     216        err = ttm_sg_tt_init(tt, bo, 0, caching);
>>     217        KUNIT_ASSERT_EQ(test, err, 0);
>>     218
>>     219        pool = kunit_kzalloc(test, sizeof(*pool), GFP_KERNEL);
>>     220        KUNIT_ASSERT_NOT_NULL(test, pool);
>>     221
>>     222        ttm_pool_init(pool, devs->dev, NUMA_NO_NODE, true, 
>> false);
>>     223
>>     224        err = ttm_pool_alloc(pool, tt, &simple_ctx);
>>     225        KUNIT_ASSERT_EQ(test, err, 0);
>>     226        KUNIT_ASSERT_EQ(test, tt->num_pages, expected_num_pages);
>>     227
>>     228        dma1 = tt->dma_address[0];
>>     229        dma2 = tt->dma_address[tt->num_pages - 1];
>>     230
>>   > 231        KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>     232        KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>     233
>>     234        ttm_pool_free(pool, tt);
>>     235        ttm_tt_fini(tt);
>>     236        ttm_pool_fini(pool);
>>     237    }
>>     238
>>



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

* Re: [linux-next:master 7361/11453] drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size
  2023-08-22 11:58   ` Christian König
@ 2023-08-22 12:58     ` Karolina Stolarek
  0 siblings, 0 replies; 4+ messages in thread
From: Karolina Stolarek @ 2023-08-22 12:58 UTC (permalink / raw)
  To: Christian König, kernel test robot
  Cc: oe-kbuild-all, Linux Memory Management List

On 22.08.2023 13:58, Christian König wrote:
> Am 22.08.23 um 08:46 schrieb Karolina Stolarek:
>> On 22.08.2023 03:14, kernel test robot wrote:
>>> Hi Karolina,
>>>
>>> FYI, the error/warning still remains.
>>
>> I sent a patch to address this warning in 
>> 20230816105508.1135410-1-karolina.stolarek@intel.com but probably got 
>> lost in the noise and hasn't been reviewed.
>>
>> Would it be possible to take a look at it?
> 
> Sorry for the delay. AMD has a new security policy and I now have 
> trouble using dim and pushing patches.

Ouch, I can imagine that's not helpful, especially for you as a 
maintainer. Still, thank you for coming to the rescue :)

> 
> Just picked this one up and pushed it to drm-misc-next-fixes.

Sorry about that warning. I'll not only double but triple-check my next 
series to avoid these...

All the best,
Karolina
> 
> Regards,
> Christian.
> 
>>
>> All the best,
>> Karolina
>>
>>>
>>> tree: 
>>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
>>> master
>>> head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
>>> commit: 204042049a941d2a9a7d49bdcda768578b5f88ec [7361/11453] 
>>> drm/ttm/tests: Add tests for ttm_pool
>>> config: arc-randconfig-r011-20230822 
>>> (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/config)
>>> compiler: arc-elf-gcc (GCC) 12.3.0
>>> reproduce: 
>>> (https://download.01.org/0day-ci/archive/20230822/202308220932.nPQdTkIN-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new 
>>> version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: 
>>> https://lore.kernel.org/oe-kbuild-all/202308220932.nPQdTkIN-lkp@intel.com/
>>>
>>> All warnings (new ones prefixed by >>):
>>>
>>>     In file included from include/drm/drm_kunit_helpers.h:6,
>>>                      from 
>>> drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h:12,
>>>                      from drivers/gpu/drm/ttm/tests/ttm_pool_test.c:10:
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c: In function 
>>> 'ttm_pool_alloc_basic_dma_addr':
>>>>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to 
>>>>> pointer from integer of different size [-Wint-to-pointer-cast]
>>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>>           |                                     ^
>>>     include/kunit/test.h:598:22: note: in definition of macro 
>>> 'KUNIT_BASE_BINARY_ASSERTION'
>>>       598 |         const typeof(left) __left = 
>>> (left);                                    \
>>>           |                      ^~~~
>>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>>> 'KUNIT_BINARY_PTR_ASSERTION'
>>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in 
>>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>>>> drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to 
>>>>> pointer from integer of different size [-Wint-to-pointer-cast]
>>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>>           |                                     ^
>>>     include/kunit/test.h:598:38: note: in definition of macro 
>>> 'KUNIT_BASE_BINARY_ASSERTION'
>>>       598 |         const typeof(left) __left = 
>>> (left);                                    \
>>>           |                                      ^~~~
>>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>>> 'KUNIT_BINARY_PTR_ASSERTION'
>>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:9: note: in 
>>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>>       231 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast 
>>> to pointer from integer of different size [-Wint-to-pointer-cast]
>>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>>           |                                     ^
>>>     include/kunit/test.h:598:22: note: in definition of macro 
>>> 'KUNIT_BASE_BINARY_ASSERTION'
>>>       598 |         const typeof(left) __left = 
>>> (left);                                    \
>>>           |                      ^~~~
>>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>>> 'KUNIT_BINARY_PTR_ASSERTION'
>>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in 
>>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:37: warning: cast 
>>> to pointer from integer of different size [-Wint-to-pointer-cast]
>>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>>           |                                     ^
>>>     include/kunit/test.h:598:38: note: in definition of macro 
>>> 'KUNIT_BASE_BINARY_ASSERTION'
>>>       598 |         const typeof(left) __left = 
>>> (left);                                    \
>>>           |                                      ^~~~
>>>     include/kunit/test.h:1384:9: note: in expansion of macro 
>>> 'KUNIT_BINARY_PTR_ASSERTION'
>>>      1384 | KUNIT_BINARY_PTR_ASSERTION(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>     include/kunit/test.h:1379:9: note: in expansion of macro 
>>> 'KUNIT_ASSERT_NOT_NULL_MSG'
>>>      1379 | KUNIT_ASSERT_NOT_NULL_MSG(test, \
>>>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~
>>>     drivers/gpu/drm/ttm/tests/ttm_pool_test.c:232:9: note: in 
>>> expansion of macro 'KUNIT_ASSERT_NOT_NULL'
>>>       232 |         KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>>           |         ^~~~~~~~~~~~~~~~~~~~~
>>>
>>>
>>> vim +231 drivers/gpu/drm/ttm/tests/ttm_pool_test.c
>>>
>>>     195
>>>     196    static void ttm_pool_alloc_basic_dma_addr(struct kunit *test)
>>>     197    {
>>>     198        struct ttm_pool_test_priv *priv = test->priv;
>>>     199        struct ttm_test_devices *devs = priv->devs;
>>>     200        const struct ttm_pool_test_case *params = 
>>> test->param_value;
>>>     201        struct ttm_tt *tt;
>>>     202        struct ttm_pool *pool;
>>>     203        struct ttm_buffer_object *bo;
>>>     204        dma_addr_t dma1, dma2;
>>>     205        enum ttm_caching caching = ttm_uncached;
>>>     206        unsigned int expected_num_pages = 1 << params->order;
>>>     207        size_t size = expected_num_pages * PAGE_SIZE;
>>>     208        int err;
>>>     209
>>>     210        tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
>>>     211        KUNIT_ASSERT_NOT_NULL(test, tt);
>>>     212
>>>     213        bo = ttm_bo_kunit_init(test, devs, size);
>>>     214        KUNIT_ASSERT_NOT_NULL(test, bo);
>>>     215
>>>     216        err = ttm_sg_tt_init(tt, bo, 0, caching);
>>>     217        KUNIT_ASSERT_EQ(test, err, 0);
>>>     218
>>>     219        pool = kunit_kzalloc(test, sizeof(*pool), GFP_KERNEL);
>>>     220        KUNIT_ASSERT_NOT_NULL(test, pool);
>>>     221
>>>     222        ttm_pool_init(pool, devs->dev, NUMA_NO_NODE, true, 
>>> false);
>>>     223
>>>     224        err = ttm_pool_alloc(pool, tt, &simple_ctx);
>>>     225        KUNIT_ASSERT_EQ(test, err, 0);
>>>     226        KUNIT_ASSERT_EQ(test, tt->num_pages, expected_num_pages);
>>>     227
>>>     228        dma1 = tt->dma_address[0];
>>>     229        dma2 = tt->dma_address[tt->num_pages - 1];
>>>     230
>>>   > 231        KUNIT_ASSERT_NOT_NULL(test, (void *)dma1);
>>>     232        KUNIT_ASSERT_NOT_NULL(test, (void *)dma2);
>>>     233
>>>     234        ttm_pool_free(pool, tt);
>>>     235        ttm_tt_fini(tt);
>>>     236        ttm_pool_fini(pool);
>>>     237    }
>>>     238
>>>
> 


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

end of thread, other threads:[~2023-08-22 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22  1:14 [linux-next:master 7361/11453] drivers/gpu/drm/ttm/tests/ttm_pool_test.c:231:37: warning: cast to pointer from integer of different size kernel test robot
2023-08-22  6:46 ` Karolina Stolarek
2023-08-22 11:58   ` Christian König
2023-08-22 12:58     ` Karolina Stolarek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox