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

From: Jonathan Cameron

Date: Tue Sep 15 2026 - 19:35:11 EST


On Mon, 14 Sep 2026 17:08:56 +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>