]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/tests: Fix endian warning
authorJosé Expósito <jose.exposito89@gmail.com>
Mon, 30 Jun 2025 09:00:53 +0000 (11:00 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 11 Aug 2025 15:24:15 +0000 (17:24 +0200)
When compiling with sparse enabled, this warning is thrown:

  warning: incorrect type in argument 2 (different base types)
     expected restricted __le32 const [usertype] *buf
     got unsigned int [usertype] *[assigned] buf

Add a cast to fix it.

Fixes: 453114319699 ("drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_xrgb2101010()")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250630090054.353246-1-jose.exposito89@gmail.com
drivers/gpu/drm/tests/drm_format_helper_test.c

index 7299fa8971ce5a5695c4dbb43d7682d86a886727..86829e1cb7f09296b0c156bfe7be2873576833e2 100644 (file)
@@ -1033,7 +1033,7 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
                NULL : &result->dst_pitch;
 
        drm_fb_xrgb8888_to_xrgb2101010(&dst, dst_pitch, &src, &fb, &params->clip, &fmtcnv_state);
-       buf = le32buf_to_cpu(test, buf, dst_size / sizeof(u32));
+       buf = le32buf_to_cpu(test, (__force const __le32 *)buf, dst_size / sizeof(u32));
        KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
 
        buf = dst.vaddr; /* restore original value of buf */