Skip to content

Commit 3351269

Browse files
matt-auldChristianKoenigAMD
authored andcommitted
drm/tests/drm_buddy: fix 32b build
Doesn't seem to compile on 32b, presumably due to u64 mod/division. Simplest is to just switch over to u32 here. Also make print modifiers consistent with that. Fixes: a64056b ("drm/tests/drm_buddy: add alloc_contiguous test") Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Cc: Arunpravin Paneer Selvam <[email protected]> Cc: Christian König <[email protected]> Cc: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
1 parent bd915ae commit 3351269

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/gpu/drm/tests/drm_buddy_test.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 chunk_size)
2121

2222
static void drm_test_buddy_alloc_contiguous(struct kunit *test)
2323
{
24-
u64 mm_size, ps = SZ_4K, i, n_pages, total;
24+
u32 mm_size, ps = SZ_4K, i, n_pages, total;
2525
struct drm_buddy_block *block;
2626
struct drm_buddy mm;
2727
LIST_HEAD(left);
@@ -56,30 +56,30 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
5656
KUNIT_ASSERT_FALSE_MSG(test,
5757
drm_buddy_alloc_blocks(&mm, 0, mm_size,
5858
ps, ps, list, 0),
59-
"buddy_alloc hit an error size=%d\n",
59+
"buddy_alloc hit an error size=%u\n",
6060
ps);
6161
} while (++i < n_pages);
6262

6363
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
6464
3 * ps, ps, &allocated,
6565
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
66-
"buddy_alloc didn't error size=%d\n", 3 * ps);
66+
"buddy_alloc didn't error size=%u\n", 3 * ps);
6767

6868
drm_buddy_free_list(&mm, &middle);
6969
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
7070
3 * ps, ps, &allocated,
7171
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
72-
"buddy_alloc didn't error size=%llu\n", 3 * ps);
72+
"buddy_alloc didn't error size=%u\n", 3 * ps);
7373
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
7474
2 * ps, ps, &allocated,
7575
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
76-
"buddy_alloc didn't error size=%llu\n", 2 * ps);
76+
"buddy_alloc didn't error size=%u\n", 2 * ps);
7777

7878
drm_buddy_free_list(&mm, &right);
7979
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
8080
3 * ps, ps, &allocated,
8181
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
82-
"buddy_alloc didn't error size=%llu\n", 3 * ps);
82+
"buddy_alloc didn't error size=%u\n", 3 * ps);
8383
/*
8484
* At this point we should have enough contiguous space for 2 blocks,
8585
* however they are never buddies (since we freed middle and right) so
@@ -88,13 +88,13 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
8888
KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
8989
2 * ps, ps, &allocated,
9090
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
91-
"buddy_alloc hit an error size=%d\n", 2 * ps);
91+
"buddy_alloc hit an error size=%u\n", 2 * ps);
9292

9393
drm_buddy_free_list(&mm, &left);
9494
KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
9595
3 * ps, ps, &allocated,
9696
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
97-
"buddy_alloc hit an error size=%d\n", 3 * ps);
97+
"buddy_alloc hit an error size=%u\n", 3 * ps);
9898

9999
total = 0;
100100
list_for_each_entry(block, &allocated, link)

0 commit comments

Comments
 (0)