Re: [PATCH v9 1/3] cxl/region: Simplify poison_by_decoder() error handling

From: Jonathan Cameron

Date: Mon Sep 21 2026 - 21:18:01 EST


On Wed, 5 Aug 2026 13:55:22 +0800
Richard Cheng <icheng@xxxxxxxxxx> wrote:

> "rc" carries both an error code and the loop control
> signal for device_for_each_child(), so returning it bare is misleading,
> the early guards mean "keep walking", not "no error". Zeroing "rc" to
> forgive an -EFAULT on a RAM partition adds to that by discarding what
> the device actually returned.
>
> Return a literal 0 where the walk should continue, and test the
> forgiven case directly instead of rewriting "rc". Give that test a
> name, poison_efault_forgiven(), so cxl_get_poison_unmapped() and
> poison_by_decoder() spell the same rule the same way. No functional
> change.
>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> Signed-off-by: Richard Cheng <icheng@xxxxxxxxxx>
> Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>

Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>