diff options
author | Ingo Molnar <mingo@kernel.org> | 2021-08-11 11:15:39 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2022-03-15 12:57:31 +0100 |
commit | e6abc8c3b547dec2b9b7065e586c212dca8b1c7d (patch) | |
tree | 66cbaf6f0cc5de8e2ef3f031d4fa7b4167157093 | |
parent | f887af5a735c177af6b5e6bf83fafea4bb11f170 (diff) | |
download | tip-e6abc8c3b547dec2b9b7065e586c212dca8b1c7d.tar.gz |
headers/deps: modules: Optimize <linux/buildid.h> dependencies, remove <linux/mm_types.h> inclusion
--------------------------------------------------------------------
| Combined, preprocessed C code size of header, without line markers,
| with comments stripped:
-------------------------
before: | #include <linux/buildid.h> | LOC: 1,870 | headers: 135
after: | #include <linux/buildid.h> | LOC: 182 | headers: 25
This also reduces the size of <linux/module.h> significantly:
--------------------------------------------------------------------
| Combined, preprocessed C code size of header, without line markers,
| with comments stripped:
-------------------------
before: | #include <linux/module.h> | LOC: 3,646 | headers: 191
after: | #include <linux/module.h> | LOC: 2,397 | headers: 123
Fix up dangling dependencies.
Convert the print_ip_sym() macro in <linux/kallsyms.h> to a macro. It's only used
in ~15 places, so we can avoid having to include <linux/printk.h> in all ~400 places
that include the header.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/buildid.h | 4 | ||||
-rw-r--r-- | include/linux/kallsyms.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/buildid.h b/include/linux/buildid.h index 3b7a0ff4642fd9..e62604510adc11 100644 --- a/include/linux/buildid.h +++ b/include/linux/buildid.h @@ -2,7 +2,9 @@ #ifndef _LINUX_BUILDID_H #define _LINUX_BUILDID_H -#include <linux/mm_types.h> +#include <linux/types.h> + +struct vm_area_struct; #define BUILD_ID_SIZE_MAX 20 diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 0bc1a35fad723e..11a5b98ed27c30 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -165,9 +165,6 @@ static inline bool kallsyms_show_value(const struct cred *cred) #endif /*CONFIG_KALLSYMS*/ -static inline void print_ip_sym(const char *loglvl, unsigned long ip) -{ - printk("%s[<%px>] %pS\n", loglvl, (void *) ip, (void *) ip); -} +#define print_ip_sym(loglvl, ip) printk("%s[<%px>] %pS\n", loglvl, (void *)(ip), (void *)(ip)); #endif /*_LINUX_KALLSYMS_H*/ |