Re: [PATCH v4 12/14] cxl: Simplify cxl_rd_ops allocation and handling

Jonathan Cameron
2025-11-11T15:34:23Z

On Mon, 3 Nov 2025 19:47:53 +0100
Robert Richter <rrichter@amd.com> 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@amd.com>
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@huawei.com>