diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2023-06-11 18:50:56 +0300 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-06-22 15:21:06 +0300 |
commit | 700c48b439921b67715e25380e0f67e6e490d7b8 (patch) | |
tree | e78ec4cda73a6324761c9f6f5da089e6cf33e7a6 /Makefile | |
parent | 6e7611c485315a0e4e36c763d0810677e1f26ecd (diff) | |
download | linux-700c48b439921b67715e25380e0f67e6e490d7b8.tar.xz |
modpost: use null string instead of NULL pointer for default namespace
The default namespace is the null string, "".
When set, the null string "" is converted to NULL:
s->namespace = namespace[0] ? NOFAIL(strdup(namespace)) : NULL;
When printed, the NULL pointer is get back to the null string:
sym->namespace ?: ""
This saves 1 byte memory allocated for "", but loses the readability.
In kernel-space, we strive to save memory, but modpost is a userspace
tool used to build the kernel. On modern systems, such small piece of
memory is not a big deal.
Handle the namespace string as is.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions