lib: rename TEST_MODULE to TEST_LKM
PATCH 1/1 lib: rename TEST_MODULE to TEST_LKM
The "_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature thereby violates this convention. The feature is used to compile the lib/test_module.c kernel module.
This patch renames the feature and its reference in a Makefile to "TEST_LKM", which still expresses the test of a LKM.
--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/Kconfig.debug +1 -1
@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N. -config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on m
lib/Makefile +1 -1
@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
Signature · 1 line
1.9.1
Quoted 2 lines · Valentin Rothberg
The "
_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature thereby
Is that documented anywhere?
Was this causing some kind of problem or error? Please tell us what that was if so.
Quoted 39 lines
violates this convention. The feature is used to compile the
lib/test_module.ckernel module.This patch renames the feature and its reference in a
Makefileto "TEST_LKM", which still expresses the test of a LKM.Signed-off-by Valentin Rothberg <[email protected]>--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/Kconfig.debug +1
-1@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N. -config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on mlib/Makefile +1
-1@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
Signature · 1 line
~Randy
Quoted 5 lines · Randy Dunlap
Quoted 2 lines · Valentin Rothberg
The "
_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature therebyIs that documented anywhere?
Sadly this is not made explicit, but the Kconfig code documents it. The following code (./scripts/kconfig/confdata.c) is used to generate the autoconf.h header file during the build process. When a feature is selected as a kernel module ('m'), it is suffixed with "_MODULE" to indicate it.
» » switch (*value) {
» » case 'n':
» » » break;
» » case 'm':
» » » suffix = "_MODULE";
» » » /* fall through */Quoted 1 line
Was this causing some kind of problem or error? Please tell us what that was if so.
It causes problems for static code analysis, which assumes a consistent use of the "_MODULE" suffix.
Another possible change would be to rename the reference in the Makefile to "TEST_MODULE_MODULE". Personally, I prefer my proposed patch.
Quoted 43 lines
Quoted 41 lines
violates this convention. The feature is used to compile the
lib/test_module.ckernel module.This patch renames the feature and its reference in a
Makefileto "TEST_LKM", which still expresses the test of a LKM.Signed-off-by Valentin Rothberg <[email protected]>--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/Kconfig.debug +1
-1@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N. -config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on mlib/Makefile +1
-1@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
Quoted 20 lines · Valentin Rothberg
Quoted 5 lines · Randy Dunlap
Quoted 2 lines · Valentin Rothberg
The "
_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature therebyIs that documented anywhere?
Sadly this is not made explicit, but the
Kconfigcode documents it. The following code (./scripts/kconfig/confdata.c) is used to generate theautoconf.hheader file during the build process. When a feature is selected as a kernel module ('m'), it is suffixed with "_MODULE" to indicate it.» » switch (*value) { » » case 'n': » » » break; » » case 'm': » » » suffix = "_MODULE"; » » » /* fall through */
Quoted 7 lines
Quoted 1 line
Was this causing some kind of problem or error? Please tell us what that was if so.
It causes problems for static code analysis, which assumes a consistent use of the "
_MODULE" suffix.Another possible change would be to rename the reference in the
Makefileto "TEST_MODULE_MODULE". Personally, I prefer my proposed patch.
Sure, your patch is fine, but we need to know *why* the patch is needed.
Thanks.
Quoted 40 lines
Quoted 40 lines
Quoted 40 lines
violates this convention. The feature is used to compile the
lib/test_module.ckernel module.This patch renames the feature and its reference in a
Makefileto "TEST_LKM", which still expresses the test of a LKM.Signed-off-by Valentin Rothberg <[email protected]>--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/Kconfig.debug +1
-1@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N. -config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on mlib/Makefile +1
-1@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
Signature · 1 line
~Randy
Quoted 23 lines · Randy Dunlap
Quoted 22 lines · Valentin Rothberg
Quoted 5 lines · Randy Dunlap
Quoted 2 lines · Valentin Rothberg
The "
_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature therebyIs that documented anywhere?
Sadly this is not made explicit, but the
Kconfigcode documents it. The following code (./scripts/kconfig/confdata.c) is used to generate theautoconf.hheader file during the build process. When a feature is selected as a kernel module ('m'), it is suffixed with "_MODULE" to indicate it.» » switch (*value) { » » case 'n': » » » break; » » case 'm': » » » suffix = "_MODULE"; » » » /* fall through */Quoted 1 line
Was this causing some kind of problem or error? Please tell us what that was if so.
Quoted 7 lines
Quoted 5 lines
It causes problems for static code analysis, which assumes a consistent use of the "
_MODULE" suffix.Another possible change would be to rename the reference in the
Makefileto "TEST_MODULE_MODULE". Personally, I prefer my proposed patch.Sure, your patch is fine, but we need to know *why* the patch is needed.
Thank you for pointing that out. I will take care to give more information in future patches.
Thanks,
Valentin
Quoted 44 lines
Thanks.
Quoted 40 lines
Quoted 40 lines
Quoted 40 lines
violates this convention. The feature is used to compile the
lib/test_module.ckernel module.This patch renames the feature and its reference in a
Makefileto "TEST_LKM", which still expresses the test of a LKM.Signed-off-by Valentin Rothberg <[email protected]>--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/Kconfig.debug +1
-1@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N. -config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on mlib/Makefile +1
-1@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
[Perhaps Kees hasn't seen this yet.]
Quoted 30 lines · Valentin Rothberg
Quoted 29 lines · Randy Dunlap
Quoted 27 lines · Valentin Rothberg
Quoted 5 lines · Randy Dunlap
Quoted 2 lines · Valentin Rothberg
The "
_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature therebyIs that documented anywhere?
Sadly this is not made explicit, but the
Kconfigcode documents it. The following code (./scripts/kconfig/confdata.c) is used to generate theautoconf.hheader file during the build process. When a feature is selected as a kernel module ('m'), it is suffixed with "_MODULE" to indicate it.» » switch (*value) { » » case 'n': » » » break; » » case 'm': » » » suffix = "_MODULE"; » » » /* fall through */Quoted 1 line
Was this causing some kind of problem or error? Please tell us what that was if so.
It causes problems for static code analysis, which assumes a consistent use of the "
_MODULE" suffix.Another possible change would be to rename the reference in the
Makefileto "TEST_MODULE_MODULE". Personally, I prefer my proposed patch.
Quoted 17 lines
Quoted 1 line
Sure, your patch is fine, but we need to know *why* the patch is needed.
Thank you for pointing that out. I will take care to give more information in future patches.
Thanks,
ValentinQuoted 9 lines
Thanks.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
violates this convention. The feature is used to compile the
lib/test_module.ckernel module.This patch renames the feature and its reference in a
Makefileto "TEST_LKM", which still expresses the test of a LKM.
Maybe something like "TEST_MODULE_LOAD"?
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Signed-off-by Valentin Rothberg <[email protected]>--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/Kconfig.debug +0
-0@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N.
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
lib/Kconfig.debug +1
-1-config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on mlib/Makefile +0
-0Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/Makefile obj-y += string_helpers.o · line 34
Quoted 8 lines
lib/Makefile +1
-1@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.o
Perhaps we should rename that file likewise?
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
lib/Makefile obj-y += string_helpers.o · line 37
Quoted 3 lines
lib/Makefile +0
-0obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
If something like this gets applied a follow up patch to make the kbuild system reject Kconfig symbols ending in _MODULE might be nice.
Paul Bolle
Quoted 45 lines · Paul Bolle
[Perhaps Kees hasn't seen this yet.]
Quoted 42 lines · Valentin Rothberg
Quoted 23 lines · Randy Dunlap
Quoted 22 lines · Valentin Rothberg
Quoted 5 lines · Randy Dunlap
Quoted 2 lines · Valentin Rothberg
The "
_MODULE" suffix is reserved for tristates compiled as loadable kernel modules (LKM). The "TEST_MODULE" feature therebyIs that documented anywhere?
Sadly this is not made explicit, but the
Kconfigcode documents it. The following code (./scripts/kconfig/confdata.c) is used to generate theautoconf.hheader file during the build process. When a feature is selected as a kernel module ('m'), it is suffixed with "_MODULE" to indicate it.» » switch (*value) { » » case 'n': » » » break; » » case 'm': » » » suffix = "_MODULE"; » » » /* fall through */Quoted 1 line
Was this causing some kind of problem or error? Please tell us what that was if so.
Quoted 7 lines
Quoted 5 lines
It causes problems for static code analysis, which assumes a consistent use of the "
_MODULE" suffix.Another possible change would be to rename the reference in the
Makefileto "TEST_MODULE_MODULE". Personally, I prefer my proposed patch.Sure, your patch is fine, but we need to know *why* the patch is needed.
Thank you for pointing that out. I will take care to give more information in future patches.
Thanks,
ValentinQuoted 4 lines
Thanks.
Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
violates this convention. The feature is used to compile the
lib/test_module.ckernel module.This patch renames the feature and its reference in a
Makefileto "TEST_LKM", which still expresses the test of a LKM.Maybe something like "
TEST_MODULE_LOAD"?
It has been merged already, see [1]. Sorry, I did not check if you were in the CC to let you know.
[1] http://ozlabs.org/~akpm/mmotm/broken-out/lib-rename-test_module-to-test_lkm.patch
Quoted 33 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Signed-off-by Valentin Rothberg <[email protected]>--- lib/Kconfig.debug | 2 +- lib/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/Kconfig.debug +0
-0@@ -1627,7 +1627,7 @@ config DMA_API_DEBUG If unsure, say N.Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
lib/Kconfig.debug +1
-1-config TEST_MODULE +config TEST_LKM tristate "Test module loading with 'hello world' module" default n depends on mlib/Makefile +0
-0Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/Makefile obj-y += string_helpers.o · line 34
Quoted 8 lines
lib/Makefile +1
-1@@ -31,7 +31,7 @@ obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o -obj-$(CONFIG_TEST_MODULE) += test_module.o +obj-$(CONFIG_TEST_LKM) += test_module.oPerhaps we should rename that file likewise?
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
lib/Makefile obj-y += string_helpers.o · line 37
Quoted 3 lines
lib/Makefile +0
-0obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.oIf something like this gets applied a follow up patch to make the kbuild system reject
Kconfigsymbols ending in_MODULEmight be nice.
That is a very nice idea. Please CC me if you come up with a path.
Thanks,
Valentin
Quoted 4 lines
Paul Bolle
Quoted 7 lines · Valentin Rothberg
Quoted 1 line · Paul Bolle
Maybe something like "
TEST_MODULE_LOAD"?It has been merged already, see [1]. Sorry, I did not check if you were in the CC to let you know.
[1] http://ozlabs.org/~akpm/mmotm/broken-out/lib-rename-test_module-to-test_lkm.patch
That didn't hit lkml, did it? Don't know whether mmotm is set in stone nor whether Kees has strong feelings about the name of this feature. (I suspect I'm wandering into bicycle shed territory here...).
Quoted 2 lines
Quoted 2 lines
If something like this gets applied a follow up patch to make the kbuild system reject
Kconfigsymbols ending in_MODULEmight be nice.
Will do. But you're free to beat me to it.
Thanks,
Paul Bolle
Quoted 4 lines · Paul Bolle
Quoted 3 lines · Valentin Rothberg
Quoted 1 line · Paul Bolle
Maybe something like "
TEST_MODULE_LOAD"?
Quoted 8 lines
Quoted 4 lines
It has been merged already, see [1]. Sorry, I did not check if you were in the CC to let you know.
[1] http://ozlabs.org/~akpm/mmotm/broken-out/lib-rename-test_module-to-test_lkm.patch
That didn't hit lkml, did it? Don't know whether mmotm is set in stone nor whether Kees has strong feelings about the name of this feature. (I suspect I'm wandering into bicycle shed territory here...).
Oooh! Nope, I hadn't seen this thread. Thanks for CCing me!
I have no problem at all with changing the Kconfig name. I prefer TEST_LKM over TEST_MODULE_MODULE, FWIW. :)
Thanks,
-Kees
Signature · 2 lines
Kees Cook Chrome OS Security
Quoted 2 lines · Valentin Rothberg
It has been merged already, see [1]. Sorry, I did not check if you were in the CC to let you know.
If it helps, I tend to use scripts/get_maintainer.pl when sending patches. It's a nice way to see who touched the same areas your patch touches, as well as doing all the filename and patch matching from the items listed in MAINTAINERS.
-Kees
Signature · 2 lines
Kees Cook Chrome OS Security