Re: [PATCH v3 1/6] rust: add warn_on_err macro

Alexandre Courbot
2026-04-30T15:12:00Z

On Sun Apr 26, 2026 at 10:30 PM JST, Miguel Ojeda wrote:
> On Wed, Apr 22, 2026 at 3:41 PM Alexandre Courbot <acourbot@nvidia.com> wrote:
>>
>> While we already have the `warn_on` macro, a common usage pattern in
>> Rust is to check whether a `Result` is an error. Add a helper macro that
>> allows this.
>>
>> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>
> I saw the discussion with Gary in v2 -- not sure if you are still
> putting this in. If so, and assuming Gary is OK with it, I guess it is
> fine as-is for now, but we should probably create at least a (good
> first?) issue:
>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>

Thanks - I will send a separate patch for this shortly, and take it
alongside the Nova unload series if it can be reviewed quickly.

>
> Not sure about Sashiko's report -- it may be nice to make the macro
> more transparent, even if it would be rare to use it with expressions
> where it would matter.

Gary's proposal [1] looked good, so I think we can use just that.

[1] https://lore.kernel.org/all/DI1IQE7MDV4O.5B2DVIXMX2OT@garyguo.net/