Re: [PATCH] lib/bch: use flexible array member for xi_tab
From: Andrew Morton
Date: Wed Nov 11 2026 - 19:06:08 EST
On Tue, 10 Nov 2026 18:34:58 -0800 Rosen Penev <rosenp@xxxxxxxxx> wrote:
> Convert xi_tab in struct bch_control from a separately allocated
> pointer to a flexible array member trailing the struct. This co-locates
> the xi_tab data with the struct allocation, reducing the number of
> individual heap allocations and simplifying cleanup.
>
> The xi_tab member is moved to the end of the struct and changed from
> 'unsigned int *' to 'unsigned int []'. The allocation in bch_init()
> switches from kzalloc_obj + bch_alloc to kzalloc_flex, and the
> corresponding kfree in bch_free() is removed.
Looks OK, thanks.
Seems the only users of this code are some MTD drivers. So can you
please resend this and also cc the appropriate developers/lists?