Re: [PATCH 2/2] nvme: keyring: fix conditional compilation

Christoph Hellwig
2023-10-27T05:21:30Z

On Thu, Oct 26, 2023 at 04:20:12PM +0200, Hannes Reinecke wrote:
> Host Target Keyring
> n n n
> n m m
> n y y
> m n m
> m m m
> m y y
> y n y
> y m y
> y y y
>
> So we're correct in 75% of all cases :-)
> And before we trying to figure out some weird complex kconfig syntax
> to get all cases correct I prefer the easy solution.
> Plus it has the benefit that the keyring is avialable right from the
> start, so you can pre-provision keys even before nvme is loaded.

in the 75% of cases that don't really matter, as 99% of all setups
have nvme and nvmet built modular, and for that you now build code
into the kernel for no good reason at all.

FYI, what's I've done a lot in the past for such simple helper is
to not have a Kconfig symbol at all, but let the Makefile handle
it.

A

obj-$(CONFIG_MOD1) += mod1.o mod-common.o
obj-$(CONFIG_MOD2) += mod2.o mod-common.o

will actually do the right thing here without much complicated
boilerplate.