[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202310270849.14B83B56D@keescook>
Date: Fri, 27 Oct 2023 08:50:45 -0700
From: Kees Cook <keescook@...omium.org>
To: Christoph Hellwig <hch@....de>
Cc: Steven Rostedt <rostedt@...dmis.org>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Justin Stitt <justinstitt@...gle.com>,
Kent Overstreet <kent.overstreet@...ux.dev>,
Petr Mladek <pmladek@...e.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
Jonathan Corbet <corbet@....net>,
Yun Zhou <yun.zhou@...driver.com>,
Jacob Keller <jacob.e.keller@...el.com>,
Zhen Lei <thunder.leizhen@...wei.com>,
linux-trace-kernel@...r.kernel.org,
Yosry Ahmed <yosryahmed@...gle.com>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2] seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_str()
On Fri, Oct 27, 2023 at 06:54:51AM +0200, Christoph Hellwig wrote:
> On Thu, Oct 26, 2023 at 12:40:37PM -0700, Kees Cook wrote:
> > Solve two ergonomic issues with struct seq_buf;
> >
> > 1) Too much boilerplate is required to initialize:
> >
> > struct seq_buf s;
> > char buf[32];
> >
> > seq_buf_init(s, buf, sizeof(buf));
> >
> > Instead, we can build this directly on the stack. Provide
> > DECLARE_SEQ_BUF() macro to do this:
> >
> > DECLARE_SEQ_BUF(s, 32);
>
> DECLARE_SEQ_BUF_ONSTACK maybe? But otherwise this looks like a good
> concept.
It's usable for globals too... also it's a shorter name as-is. :)
--
Kees Cook
Powered by blists - more mailing lists