Re: [PATCH 04/11] treewide: Convert struct kernel_param_ops initializers to DEFINE_KERNEL_PARAM_OPS

3 views
Skip to first unread message

Sean Christopherson

unread,
May 21, 2026, 11:11:26 AMMay 21
to Kees Cook, Luis Chamberlain, Pengpeng Hou, Petr Pavlu, Richard Weinberger, Anton Ivanov, Johannes Berg, Rafael J. Wysocki, Len Brown, Corey Minyard, Gabriel Somlo, Michael S. Tsirkin, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, David Airlie, Simona Vetter, Bart Van Assche, Jason Gunthorpe, Leon Romanovsky, Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab, Bjorn Helgaas, Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen, Daniel Lezcano, Zhang Rui, Lukasz Luba, Greg Kroah-Hartman, Jiri Slaby, Alan Stern, Jason Wang, Xuan Zhuo, Eugenio Pérez, Jason Baron, Jim Cromie, Tiwei Bie, Benjamin Berg, Ilpo Järvinen, David E. Box, Maciej W. Rozycki, Srinivas Pandruvada, Peter Zijlstra, Heiko Carstens, Vasily Gorbik, Paolo Bonzini, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x...@kernel.org, H. Peter Anvin, Vinod Koul, Frank Li, Daniel Gomez, Sami Tolvanen, Aaron Tomlin, Alexander Potapenko, Marco Elver, Dmitry Vyukov, Andrew Morton, John Johansen, Paul Moore, James Morris, Serge E. Hallyn, Andy Shevchenko, Georgia Garcia, k...@vger.kernel.org, dmae...@vger.kernel.org, linux-...@vger.kernel.org, kasa...@googlegroups.com, linu...@kvack.org, appa...@lists.ubuntu.com, linux-secu...@vger.kernel.org, linu...@lists.infradead.org, linux...@vger.kernel.org, openipmi-...@lists.sourceforge.net, qemu-...@nongnu.org, inte...@lists.freedesktop.org, dri-...@lists.freedesktop.org, linux...@vger.kernel.org, linux...@vger.kernel.org, linu...@vger.kernel.org, linux...@vger.kernel.org, linu...@vger.kernel.org, linuxp...@lists.ozlabs.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, usb-s...@lists.one-eyed-alien.net, virtual...@lists.linux.dev, linux-...@vger.kernel.org, linux...@vger.kernel.org, net...@vger.kernel.org, linux-...@vger.kernel.org, linux-h...@vger.kernel.org
On Thu, May 21, 2026, Kees Cook wrote:
> Using Coccinelle, rewrite every struct kernel_param_ops initializer that
> sets .get into a DEFINE_KERNEL_PARAM_OPS-family macro invocation,
> for example:
>
> @@
> declarer name DEFINE_KERNEL_PARAM_OPS;
> identifier OPS;
> expression SET, GET;
> @@
> - const struct kernel_param_ops OPS = {
> - .set = SET,
> - .get = GET,
> - };
> + DEFINE_KERNEL_PARAM_OPS(OPS, SET, GET);

IMO, "OPS, GET, SET" is more intuitive, especially since that's the order used
by DEFINE_SIMPLE_ATTRIBUTE and DEFINE_DEBUGFS_ATTRIBUTE.
Reply all
Reply to author
Forward
0 new messages