Skip to contentSkip to conversation

util_macros.h: Make the header more resilient

PATCH Applied Andy Shevchenko 2 participants 4 messages Apr 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util_macros.h: Make the header more resilient

Add missing header inclusions and protect against double inclusion.

---
 include/linux/util_macros.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/util_macros.h +3 -0
index 7b64fb597f85..8239a7748f49 100644
@@ -2,7 +2,10 @@
 #ifndef _LINUX_HELPER_MACROS_H_
 #define _LINUX_HELPER_MACROS_H_
 
+#include <linux/compiler_attributes.h>
 #include <linux/math.h>
+#include <linux/typecheck.h>
+#include <linux/stddef.h>
 
 /**
  * for_each_if - helper for handling conditionals in various for_each macros
Signature · 1 line
2.47.2
#1 lore raw
Quoted 1 line · On Mon, 28 Apr 2025 10:27:54 +0300 Andy Shevchenko…

Add missing header inclusions and protect against double inclusion.

The patch doesn't "protect against double inclusion"?

Quoted 15 lines
include/linux/util_macros.h +3 -0
@@ -2,7 +2,10 @@
 #ifndef _LINUX_HELPER_MACROS_H_
 #define _LINUX_HELPER_MACROS_H_
 
+#include <linux/compiler_attributes.h>
 #include <linux/math.h>
+#include <linux/typecheck.h>
+#include <linux/stddef.h>
 
 /**
  * for_each_if - helper for handling conditionals in various for_each macros
Signature · 1 line
2.47.2
#2 lore raw
Quoted 5 lines · Andrew Morton
Quoted 1 line · On Mon, 28 Apr 2025 10:27:54 +0300 Andy Shevchenko…

Add missing header inclusions and protect against double inclusion.

The patch doesn't "protect against double inclusion"?

Hmm... Not really. This is a copy'n'paste leftover. Can you remove that part when applying or should I send a new version?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 9 lines · On Mon, 28 Apr 2025 13:06:06 +0300 Andy Shevchenko…
Quoted 5 lines · Andrew Morton
Quoted 1 line · On Mon, 28 Apr 2025 10:27:54 +0300 Andy Shevchenko…

Add missing header inclusions and protect against double inclusion.

The patch doesn't "protect against double inclusion"?

Hmm... Not really. This is a copy'n'paste leftover. Can you remove that part when applying or should I send a new version?

No probs, I altered the changelog.