linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Karolina Stolarek <karolina.stolarek@intel.com>,
	kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: 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
Date: Tue, 22 Aug 2023 13:58:48 +0200	[thread overview]
Message-ID: <2d9b87d4-76fa-e7f3-0f39-711fe7e3110f@amd.com> (raw)
In-Reply-To: <0079be8b-40ab-5c63-b04a-f5265ec3613c@intel.com>

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



  reply	other threads:[~2023-08-22 11:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  1:14 kernel test robot
2023-08-22  6:46 ` Karolina Stolarek
2023-08-22 11:58   ` Christian König [this message]
2023-08-22 12:58     ` Karolina Stolarek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d9b87d4-76fa-e7f3-0f39-711fe7e3110f@amd.com \
    --to=christian.koenig@amd.com \
    --cc=karolina.stolarek@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox