From: Petr Mladek <pmladek@suse.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Nathan Chancellor" <nathan@kernel.org>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"John Ogness" <john.ogness@linutronix.de>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Sergey Senozhatsky" <senozhatsky@chromium.org>,
"Kees Cook" <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"David Gow" <davidgow@google.com>,
"Arnd Bergmann" <arnd@kernel.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 2/3] printk: kunit: support offstack cpumask
Date: Tue, 2 Sep 2025 15:55:27 +0200 [thread overview]
Message-ID: <aLb3T6hjtX4M37dA@pathway.suse.cz> (raw)
In-Reply-To: <1217f48f-a12a-4ba1-8de5-bda4b2ad6107@app.fastmail.com>
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
next prev parent reply other threads:[~2025-09-02 13:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 9:51 [PATCH 0/3] printk: KUnit: Followup fixes for the new KUnit test Petr Mladek
2025-07-02 9:51 ` [PATCH 1/3] printk: ringbuffer: Explain why the KUnit test ignores failed writes Petr Mladek
2025-07-04 11:28 ` John Ogness
2025-07-02 9:51 ` [PATCH 2/3] printk: kunit: support offstack cpumask Petr Mladek
2025-07-02 20:28 ` Nathan Chancellor
2025-07-08 14:24 ` Petr Mladek
2025-07-08 14:48 ` Arnd Bergmann
2025-07-09 11:36 ` Petr Mladek
2025-07-09 12:53 ` Thomas Weißschuh
2025-07-10 13:51 ` Petr Mladek
2025-07-10 14:08 ` Arnd Bergmann
2025-09-02 13:55 ` Petr Mladek [this message]
2025-07-03 14:36 ` kernel test robot
2025-07-02 9:51 ` [PATCH 3/3] printk: kunit: Fix __counted_by() in struct prbtest_rbdata Petr Mladek
2025-07-04 11:41 ` John Ogness
2025-07-02 15:48 ` [PATCH 0/3] printk: KUnit: Followup fixes for the new KUnit test Thomas Weißschuh
2025-07-10 15:29 ` Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aLb3T6hjtX4M37dA@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=davidgow@google.com \
--cc=gustavoars@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox