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

From: Dan Williams <[email-masked]>
Date: Tue, 13 May 2025 11:37:51 -0700

Cedric Xing wrote:
> Commit 9bec944506fa ("sysfs: constify attribute_group::bin_attrs") enforced
> the ro-after-init principle by making elements of bin_attrs_new 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 when assigning
> to bin_attrs_new.
> 
> Signed-off-by: Cedric Xing <[email-masked]>

Looks good to me, added to linux-next for more exposure.