Re: [PATCH v4 12/14] cxl: Simplify cxl_rd_ops allocation and handling
From: Jonathan Cameron
Date: Tue Nov 11 2025 - 10:34:23 EST
On Mon, 3 Nov 2025 19:47:53 +0100
Robert Richter <rrichter@xxxxxxx> wrote:
> A root decoder's callback handlers are collected in struct cxl_rd_ops.
> The structure is dynamically allocated, though it contains only a few
> pointers in it. This also requires to check two pointes to check for
> the existance of a callback.
>
> Simplify the allocation, release and handler check by embedding the
> ops statical in struct cxl_root_decoder.
>
> Implementation is equivalent to how struct cxl_root_ops handles the
> callbacks.
>
> Signed-off-by: Robert Richter <rrichter@xxxxxxx>
Given we aren't picking between big sets of static const ops but
instead just 2 (in which case the indirection would be a good idea),
I'm fine with this as a simplication over dynamic allocation.
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>