linux/scripts/mod
Masahiro Yamada 700c48b439 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>
2023-06-22 21:21:06 +09:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
devicetable-offsets.c cdx: add the cdx bus driver 2023-03-29 12:26:32 +02:00
empty.c
file2alias.c cdx: add the cdx bus driver 2023-03-29 12:26:32 +02:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
Makefile scripts/mod: disable LTO for empty.c 2021-01-14 08:21:09 -08:00
mk_elfconfig.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
modpost.c modpost: use null string instead of NULL pointer for default namespace 2023-06-22 21:21:06 +09:00
modpost.h kbuild: generate KSYMTAB entries by modpost 2023-06-22 21:17:10 +09:00
sumversion.c modpost: fix array_size.cocci warning 2022-11-21 10:18:39 +09:00