[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ya5qrjabKMM6sPr+@casper.infradead.org>
Date: Mon, 6 Dec 2021 19:55:26 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Miguel Ojeda <ojeda@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
rust-for-linux <rust-for-linux@...r.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Gary Guo <gary@...yguo.net>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...gle.com>
Subject: Re: [PATCH 11/19] vsprintf: add new `%pA` format specifier
On Mon, Dec 06, 2021 at 11:52:09AM -0800, Nick Desaulniers wrote:
> On Mon, Dec 6, 2021 at 8:14 AM Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> >
> > On Mon, Dec 06, 2021 at 04:56:32PM +0100, Miguel Ojeda wrote:
> > > On Mon, Dec 6, 2021 at 4:46 PM Greg Kroah-Hartman
> > > <gregkh@...uxfoundation.org> wrote:
> > > >
> > > > That should be in a .h file somewhere. Remember, don't put #ifdef in .c
> > > > files please.
>
> Why not put #ifdef in .c files?
>
> > > Will do, thanks for reviewing!
> > >
> > > > Same here, this should not be needed if you put it in a .h file
> > > > correctly.
>
> I guess IS_ENABLED could be used in the .c code, but I don't see how
> they could move the dispatch to rust_fmt_argument to a header without
> moving the definition of pointer() to a header, which they probably
> _cant_ do because it's noinline_for_stack.
In the header file, you put:
#ifdef CONFIG_FOO
int foo(void);
#else
static inline int foo(void) { }
#endif
and then in your .c file, you call foo() unconditionally, and everything
works beautifully.
Powered by blists - more mailing lists