aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2022-01-06 13:30:52 +0100
committerIngo Molnar <mingo@kernel.org>2022-03-15 12:57:41 +0100
commit961d7ee21d7dbb856dc49d55f5ed29ed128ff800 (patch)
tree02009faf9bf05399d70da5f14631576fe8ce53df
parent96c6bdffb86ea42fc45ee693085af7dd686f3469 (diff)
downloadtip-961d7ee21d7dbb856dc49d55f5ed29ed128ff800.tar.gz
headers/deps: uts: Optimize <linux/utsname.h> dependencies, remove <linux/sched.h> inclusion
-------------------------------------------------------------------- | Combined, preprocessed C code size of header, without line markers, | with comments stripped: ------------------------- before: | #include <linux/utsname.h> | LOC: 4,073 | headers: 122 after: | #include <linux/utsname.h> | LOC: 3,573 | headers: 98 Convert utsname() to a macro - this is a rarely used API used only in 38 .c files out of 30,000+, and those files can include <linux/sched.h> explicitly. Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--include/linux/utsname.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 75111f01c458f3..2750b1318b25d3 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -4,7 +4,6 @@
#include <linux/refcount_api.h>
-#include <linux/sched.h>
#include <linux/nsproxy.h>
#include <linux/ns_common.h>
#include <linux/err.h>
@@ -77,10 +76,7 @@ static inline void uts_proc_notify(enum uts_proc proc)
}
#endif
-static inline struct new_utsname *utsname(void)
-{
- return &current->nsproxy->uts_ns->name;
-}
+#define utsname() (&current->nsproxy->uts_ns->name)
static inline struct new_utsname *init_utsname(void)
{