regmap: REGMAP_KUNIT should not select REGMAP
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 26 Apr 2023 13:35:45 +0000 (15:35 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 8 May 2023 00:07:51 +0000 (09:07 +0900)
commit70a640c0efa7667453c3911b13335304ce46ad8b
tree2aef6fd1e4b1ca9f5ec0d294d352a56e50039b96
parentac9a78681b921877518763ba0e89202254349d1b
regmap: REGMAP_KUNIT should not select REGMAP

Enabling a (modular) test should not silently enable additional kernel
functionality, as that may increase the attack vector of a product.

Fix this by:
  1. making REGMAP visible if CONFIG_KUNIT_ALL_TESTS is enabled,
  2. making REGMAP_KUNIT depend on REGMAP instead of selecting it.

After this, one can safely enable CONFIG_KUNIT_ALL_TESTS=m to build
modules for all appropriate tests for ones system, without pulling in
extra unwanted functionality, while still allowing a tester to manually
enable REGMAP and its test suite on a system where REGMAP is not enabled
by default.

Fixes: 2238959b6ad27040 ("regmap: Add some basic kunit tests")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org
Link: https://lore.kernel.org/r/b0a5dbb17c1d5ea482e052e585ae83bb69c48806.1682516005.git.geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org
drivers/base/regmap/Kconfig