linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] kfifo: Clean up kfifo.h
@ 2024-04-23 19:23 Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 1/3] media: rc: Add missing io.h Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-04-23 19:23 UTC (permalink / raw)
  To: Andy Shevchenko, Rob Herring, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, linux-sunxi
  Cc: Alain Volmat, Hans Verkuil, Mauro Carvalho Chehab, Sean Wang,
	Sean Young, Matthias Brugger, AngeloGioacchino Del Regno,
	Patrice Chotard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Stefani Seibold, Andrew Morton

To reduce a dependency hell degree, clean up kfifo.h
(mainly getting rid of kernel.h in the global header).

In v2:
- rebased on top of v6.9-rc5 (Andrew)
- retested again with `make allyesconfig` on x86_64,
  hence first two new patches

Andy Shevchenko (3):
  media: rc: Add missing io.h
  media: stih-cec: Add missing io.h
  kfifo: Don't use "proxy" headers

 drivers/media/cec/platform/sti/stih-cec.c |  1 +
 drivers/media/rc/mtk-cir.c                |  1 +
 drivers/media/rc/serial_ir.c              |  1 +
 drivers/media/rc/st_rc.c                  |  1 +
 drivers/media/rc/sunxi-cir.c              |  1 +
 include/linux/kfifo.h                     |  9 +++++++--
 lib/kfifo.c                               | 10 +++++-----
 samples/kfifo/dma-example.c               |  3 ++-
 8 files changed, 19 insertions(+), 8 deletions(-)

-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* [PATCH v2 1/3] media: rc: Add missing io.h
  2024-04-23 19:23 [PATCH v2 0/3] kfifo: Clean up kfifo.h Andy Shevchenko
@ 2024-04-23 19:23 ` Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 2/3] media: stih-cec: " Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 3/3] kfifo: Don't use "proxy" headers Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-04-23 19:23 UTC (permalink / raw)
  To: Andy Shevchenko, Rob Herring, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, linux-sunxi
  Cc: Alain Volmat, Hans Verkuil, Mauro Carvalho Chehab, Sean Wang,
	Sean Young, Matthias Brugger, AngeloGioacchino Del Regno,
	Patrice Chotard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Stefani Seibold, Andrew Morton

In many remote control drivers the io.h is implied by others.
This is not good as it prevents from cleanups done in other headers.
Add missing include.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/rc/mtk-cir.c   | 1 +
 drivers/media/rc/serial_ir.c | 1 +
 drivers/media/rc/st_rc.c     | 1 +
 drivers/media/rc/sunxi-cir.c | 1 +
 4 files changed, 4 insertions(+)

diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c
index 4e294e59d3cb..b2f82b2d1c8d 100644
--- a/drivers/media/rc/mtk-cir.c
+++ b/drivers/media/rc/mtk-cir.c
@@ -8,6 +8,7 @@
 #include <linux/clk.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/io.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c
index 96ae0294ac10..fc5fd3927177 100644
--- a/drivers/media/rc/serial_ir.c
+++ b/drivers/media/rc/serial_ir.c
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/serial_reg.h>
 #include <linux/types.h>
diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 28477aa95563..988b09191c4c 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -6,6 +6,7 @@
 #include <linux/kernel.h>
 #include <linux/clk.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index bf58c965ead8..b49df8355e6b 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -12,6 +12,7 @@
 
 #include <linux/clk.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* [PATCH v2 2/3] media: stih-cec: Add missing io.h
  2024-04-23 19:23 [PATCH v2 0/3] kfifo: Clean up kfifo.h Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 1/3] media: rc: Add missing io.h Andy Shevchenko
@ 2024-04-23 19:23 ` Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 3/3] kfifo: Don't use "proxy" headers Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-04-23 19:23 UTC (permalink / raw)
  To: Andy Shevchenko, Rob Herring, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, linux-sunxi
  Cc: Alain Volmat, Hans Verkuil, Mauro Carvalho Chehab, Sean Wang,
	Sean Young, Matthias Brugger, AngeloGioacchino Del Regno,
	Patrice Chotard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Stefani Seibold, Andrew Morton

In the driver the io.h is implied by others. This is not good as
it prevents from cleanups done in other headers. Add missing include.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/cec/platform/sti/stih-cec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/cec/platform/sti/stih-cec.c b/drivers/media/cec/platform/sti/stih-cec.c
index a20fc5c0c88d..99978a7c8d9b 100644
--- a/drivers/media/cec/platform/sti/stih-cec.c
+++ b/drivers/media/cec/platform/sti/stih-cec.c
@@ -6,6 +6,7 @@
  */
 #include <linux/clk.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* [PATCH v2 3/3] kfifo: Don't use "proxy" headers
  2024-04-23 19:23 [PATCH v2 0/3] kfifo: Clean up kfifo.h Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 1/3] media: rc: Add missing io.h Andy Shevchenko
  2024-04-23 19:23 ` [PATCH v2 2/3] media: stih-cec: " Andy Shevchenko
@ 2024-04-23 19:23 ` Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-04-23 19:23 UTC (permalink / raw)
  To: Andy Shevchenko, Rob Herring, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, linux-sunxi
  Cc: Alain Volmat, Hans Verkuil, Mauro Carvalho Chehab, Sean Wang,
	Sean Young, Matthias Brugger, AngeloGioacchino Del Regno,
	Patrice Chotard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Stefani Seibold, Andrew Morton

Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/kfifo.h       |  9 +++++++--
 lib/kfifo.c                 | 10 +++++-----
 samples/kfifo/dma-example.c |  3 ++-
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 0b35a41440ff..6b28d642f332 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -36,10 +36,15 @@
  * to lock the reader.
  */
 
-#include <linux/kernel.h>
+#include <linux/array_size.h>
 #include <linux/spinlock.h>
 #include <linux/stddef.h>
-#include <linux/scatterlist.h>
+#include <linux/types.h>
+
+#include <asm/barrier.h>
+#include <asm/errno.h>
+
+struct scatterlist;
 
 struct __kfifo {
 	unsigned int	in;
diff --git a/lib/kfifo.c b/lib/kfifo.c
index 12f5a347aa13..15acdee4a8f3 100644
--- a/lib/kfifo.c
+++ b/lib/kfifo.c
@@ -5,13 +5,13 @@
  * Copyright (C) 2009/2010 Stefani Seibold <stefani@seibold.net>
  */
 
-#include <linux/kernel.h>
-#include <linux/export.h>
-#include <linux/slab.h>
 #include <linux/err.h>
-#include <linux/log2.h>
-#include <linux/uaccess.h>
+#include <linux/export.h>
 #include <linux/kfifo.h>
+#include <linux/log2.h>
+#include <linux/scatterlist.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
 
 /*
  * internal helper to calculate the unused elements in a fifo
diff --git a/samples/kfifo/dma-example.c b/samples/kfifo/dma-example.c
index 0cf27483cb36..74fe915b7ffe 100644
--- a/samples/kfifo/dma-example.c
+++ b/samples/kfifo/dma-example.c
@@ -6,8 +6,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/kfifo.h>
+#include <linux/module.h>
+#include <linux/scatterlist.h>
 
 /*
  * This module shows how to handle fifo dma operations.
-- 
2.43.0.rc1.1336.g36b5255a03ac


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

end of thread, other threads:[~2024-04-23 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 19:23 [PATCH v2 0/3] kfifo: Clean up kfifo.h Andy Shevchenko
2024-04-23 19:23 ` [PATCH v2 1/3] media: rc: Add missing io.h Andy Shevchenko
2024-04-23 19:23 ` [PATCH v2 2/3] media: stih-cec: " Andy Shevchenko
2024-04-23 19:23 ` [PATCH v2 3/3] kfifo: Don't use "proxy" headers Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).