On Tue 2025-07-08 16:48:47, Arnd Bergmann wrote: > On Tue, Jul 8, 2025, at 16:24, Petr Mladek wrote: > > On Wed 2025-07-02 13:28:35, Nathan Chancellor wrote: > >> On Wed, Jul 02, 2025 at 11:51:56AM +0200, Petr Mladek wrote: > > > > Thanks a lot for the nice report. > > > > The problem is how cpumask_var_t is defined in > > include/linux/cpumask_types.h: > > > > #ifdef CONFIG_CPUMASK_OFFSTACK > > typedef struct cpumask *cpumask_var_t; > > #else > > typedef struct cpumask cpumask_var_t[1]; > > #endif /* CONFIG_CPUMASK_OFFSTACK */ > > > > And KUNIT_DEFINE_ACTION_WRAPPER() expect that the 3rd parameter > > is a pointer. > > > > I am going to solve this by adding a wrapper over free_cpumask_var() > > which would work with a pointer to cpumask_var_t. > > I'm not familiar enough with the cleanup mechanism of kunit, > but can't you just move the mask allocation outside of > test_readerwriter()? > > > + */ > > +static void prbtest_free_cpumask_var(cpumask_var_t *mask) > > +{ > > + free_cpumask_var(*mask); > > +} > > Or you could pass this as a cpumask_t pointer instead, > which should do the right thing without the indirection.
It was actually enough to use this in the KUNIT_DEFINE_ACTION_WRAPPER() definition. It removed the warning about passing an array type. And I needed neither a wrapper not #ifdef. I am going to send an updated version of the patch. I am sorry that it took so long. This patch has fallen though cracks because of vacation and other urgent tasks. Best Regards, Petr