[PATCH v3 18/20] drm/vc4: tests: Fail the current test if we access a register

Maxime Ripard maxime at cerno.tech
Wed Dec 7 16:11:54 UTC 2022


Hi Maíra,

Thanks for your review!

On Wed, Dec 07, 2022 at 11:26:13AM -0300, Maíra Canal wrote:
> On 12/1/22 12:11, Maxime Ripard wrote:
> > Accessing a register when running under kunit is a bad idea since our
> > device is completely mocked.
> > 
> > Fail the current test if we ever access any of our hardware registers.
> > 
> > Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>
> > Signed-off-by: Maxime Ripard <maxime at cerno.tech>
> 
> Reviewed-by: Maíra Canal <mcanal at igalia.com>
> 
> Just a small nit: I believe that macros with multiple statements should be
> enclosed in a do-while block [1], even READ macros. I saw that you enclosed
> the WRITE macros on a do-while block, but not the READ macros.

This is on purpose: do-while blocks don't return a value, but ({ ... })
blocks do. So we can do a write macros with a do-while, but can't for
read since we expect to get a value back.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20221207/7668400e/attachment.sig>


More information about the dri-devel mailing list