Re: [PATCH v4 2/2] bug: introduce ASSERT_VAR_CAN_HOLD()

From: Christoph Hellwig
Date: Tue Mar 26 2024 - 03:56:29 EST


On Mon, Mar 25, 2024 at 09:31:05AM +0100, Petr Tesarik wrote:
> From: Petr Tesarik <petr.tesarik1@xxxxxxxxxxxxxxxxxxx>
>
> Introduce an ASSERT_VAR_CAN_HOLD() macro to check at build time that a
> variable can hold the given value.

This really should be run past whoever maintains build_bug.h and
also cc linux-kernel. Please also split the addition and the user
in swiotlb into separate patches.

I plan to pick up patch 1 for now, and wait for the discussion on
this addition.