public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE()
@ 2022-10-24 15:44 Alexey Dobriyan
  2022-10-24 16:05 ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Dobriyan @ 2022-10-24 15:44 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: mingo, akpm, linux-kernel

> include/linux/array_size.h | 13 +++++++++++++

All of this is pessimisation unless you're removing

	+#include <linux/array_size.h>

from kernel.h which you aren't doing.

container_of.h is just as silly.

kernel.h might need _some_ cleanup (like panic and tainted stuff) which
is rarely used but ARRAY_SIZE()?

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [rft, PATCH v1 1/4] kernel.h: Move READ/WRITE definitions to <linux/types.h>
@ 2022-10-24 13:24 Andy Shevchenko
  2022-10-24 13:24 ` [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE() Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2022-10-24 13:24 UTC (permalink / raw)
  To: Andy Shevchenko, Ingo Molnar, linux-kernel; +Cc: Andrew Morton

From: Ingo Molnar <mingo@kernel.org>

Headers shouldn't be forced to include <linux/kernel.h> just to
gain these simple constants.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/kernel.h | 4 ----
 include/linux/types.h  | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fe6efb24d151..bc3e0364970a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -44,10 +44,6 @@
  */
 #define REPEAT_BYTE(x)	((~0ul / 0xff) * (x))
 
-/* generic data direction definitions */
-#define READ			0
-#define WRITE			1
-
 /**
  * ARRAY_SIZE - get the number of elements in array @arr
  * @arr: array to be sized
diff --git a/include/linux/types.h b/include/linux/types.h
index ea8cf60a8a79..67846bc43d53 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -125,6 +125,10 @@ typedef s64			int64_t;
 typedef u64 sector_t;
 typedef u64 blkcnt_t;
 
+/* generic data direction definitions */
+#define READ			0
+#define WRITE			1
+
 /*
  * The type of an index into the pagecache.
  */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-30 21:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24 15:44 [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE() Alexey Dobriyan
2022-10-24 16:05 ` Andy Shevchenko
2022-10-24 16:06   ` Andy Shevchenko
2022-10-24 18:14   ` Alexey Dobriyan
2022-10-25  8:20     ` Andy Shevchenko
2022-10-29 10:05       ` Alexey Dobriyan
2022-10-30 21:52         ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 13:24 [rft, PATCH v1 1/4] kernel.h: Move READ/WRITE definitions to <linux/types.h> Andy Shevchenko
2022-10-24 13:24 ` [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox