Re: [PATCH] iomap: hide iomap_sector with CONFIG_BLOCK=n

From: Masahiro Yamada
Date: Thu Jul 18 2019 - 22:20:18 EST


Hi.

On Thu, Jul 18, 2019 at 11:28 PM Darrick J. Wong
<darrick.wong@xxxxxxxxxx> wrote:
>
> On Thu, Jul 18, 2019 at 03:08:35PM +0200, Christoph Hellwig wrote:
> > On Thu, Jul 18, 2019 at 03:03:15PM +0200, Arnd Bergmann wrote:
> > > The inclusion comes from the recently added header check in commit
> > > c93a0368aaa2 ("kbuild: do not create wrappers for header-test-y").
> > >
> > > This just tries to include every header by itself to see if there are build
> > > failures from missing indirect includes. We probably don't want to
> > > add an exception for iomap.h there.
> >
> > I very much disagree with that check. We don't need to make every
> > header compilable with a setup where it should not be included.
>
> Seconded, unless there's some scenario where someone needs iomap when
> CONFIG_BLOCK=n (???)

I agree.

There is no situation that iomap.h is included when CONFIG_BLOCK=n.
So, it is pointless to surround offending code with #ifdef
just for the purpose of satisfying the header-test.


I started to think
compiling all headers is more painful than useful.


MW is closing, so I am thinking of disabling it for now
to take time to re-think.


diff --git a/init/Kconfig b/init/Kconfig
index bd7d650d4a99..cbb31d134f7e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -111,6 +111,7 @@ config HEADER_TEST
config KERNEL_HEADER_TEST
bool "Compile test kernel headers"
depends on HEADER_TEST
+ depends on BROKEN
help
Headers in include/ are used to build external moduls.
Compile test them to ensure they are self-contained, i.e.



Maybe, we should compile-test headers
only when it is reasonable to do so.

--
Best Regards
Masahiro Yamada