Re: [PATCH v5 1/2] regmap: add flat cache with sparse validity

From: Sander Vanheule

Date: Tue Oct 28 2025 - 07:50:58 EST


Hi Mark,

On Tuesday, 28 October 2025, Mark Brown wrote:
> On Thu, Oct 23, 2025 at 03:50:31PM +0200, Sander Vanheule wrote:
>
> > - map->cache = kcalloc(regcache_flat_get_index(map, map->max_register)
> > - + 1, sizeof(unsigned int), map->alloc_flags);
>
> > + cache = kmalloc(cache_data_size, map->alloc_flags);
>
> kcalloc() does a zero initialisation so should be replace by kzalloc()
> rather than kmalloc(), otherwise we break existing users who rely on the
> zero initialisation.

Of course. The intention is to maintain backward compatibility with the current flat cache, so I'll send a respin amending this.

Best,
Sander