lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGQQjTUrG8-p8qAC@fedora>
Date: Tue, 1 Jul 2025 18:45:01 +0200
From: José Expósito <jose.exposito89@...il.com>
To: Michel Dänzer <michel.daenzer@...lbox.org>
Cc: maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
	tzimmermann@...e.de, airlied@...il.com, simona@...ll.ch,
	lumag@...nel.org, cristian.ciocaltea@...labora.com,
	gcarlos@...root.org, dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] drm/tests: Fix endian warning

Hey Michel,

Thanks for looking into this.

On Tue, Jul 01, 2025 at 10:22:13AM +0200, Michel Dänzer wrote:
> On 30.06.25 11:00, José Expósito wrote:
> > 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@...il.com>
> > ---
> >  drivers/gpu/drm/tests/drm_format_helper_test.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c
> > index 7299fa8971ce..86829e1cb7f0 100644
> > --- a/drivers/gpu/drm/tests/drm_format_helper_test.c
> > +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
> > @@ -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 */
> 
> It might be cleaner to use two separate variables instead of using "buf" as both little endian and host byte order. (Same for patch 2)

Yes, however, the same pattern is repeated 10 times in this file.

What do you think about fixing it in a follow up? I don't think it
should block fixing the KUnit tests.

Jose

> 
> -- 
> Earthling Michel Dänzer       \        GNOME / Xwayland / Mesa developer
> https://redhat.com             \               Libre software enthusiast

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ