Subject: Re: [PATCH] tsm-mr: Fix init breakage after bin_attrs constification by scoping non-const pointers to init phase

From: Thomas Weißschuh <[email-masked]>
Date: Tue, 13 May 2025 18:24:15 +0200

On 2025-05-13 10:47:42-0500, Cedric Xing wrote:
> Commit 9bec944506fa ("sysfs: constify attribute_group::bin_attrs") enforced
> the ro-after-init principle by making elements of bin_attrs pointing to
> const.
> 
> To align with this change, introduce a temporary variable `bap` within the
> initialization loop. This improves code clarity by explicitly marking the
> initialization scope and eliminates the need for type casts after bin_attrs
> was constified.

Please also switch to .bin_attrs_new instead of .bin_attrs.
To make sure that the code is compatible with the new logic.

> Signed-off-by: Cedric Xing <[email-masked]>
> ---
>  drivers/virt/coco/tsm-mr.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)

<snip>