mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers
@ 2025-07-09  8:37 Andy Shevchenko
  2025-07-09 22:37 ` Jacob Keller
  2025-07-13  2:05 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-07-09  8:37 UTC (permalink / raw)
  To: Leon Romanovsky, Tariq Toukan, Shahar Shitrit, linux-rdma,
	linux-kernel, netdev
  Cc: Jason Gunthorpe, Saeed Mahameed, Mark Bloch, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andy Shevchenko

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

Note that kernel.h is discouraged to be included as it's written
at the top of that file.

While doing that, sort headers alphabetically.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

v2: fixed a few compilation issues in some cases (LKP)

 drivers/infiniband/hw/mlx5/mlx5_ib.h          | 17 ++++---
 .../ethernet/mellanox/mlx5/core/mlx5_core.h   | 12 +++--
 include/linux/mlx5/driver.h                   | 47 ++++++++++++-------
 3 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index a012e24d3afe..3e8c8ddda045 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -7,20 +7,23 @@
 #ifndef MLX5_IB_H
 #define MLX5_IB_H
 
-#include <linux/kernel.h>
+#include <linux/mempool.h>
 #include <linux/sched.h>
-#include <rdma/ib_verbs.h>
-#include <rdma/ib_umem.h>
+#include <linux/types.h>
+
 #include <rdma/ib_smi.h>
-#include <linux/mlx5/driver.h>
+#include <rdma/ib_umem.h>
+#include <rdma/ib_user_verbs.h>
+#include <rdma/ib_verbs.h>
+#include <rdma/uverbs_ioctl.h>
+
 #include <linux/mlx5/cq.h>
+#include <linux/mlx5/driver.h>
 #include <linux/mlx5/fs.h>
 #include <linux/mlx5/qp.h>
-#include <linux/types.h>
 #include <linux/mlx5/transobj.h>
-#include <rdma/ib_user_verbs.h>
+
 #include <rdma/mlx5-abi.h>
-#include <rdma/uverbs_ioctl.h>
 #include <rdma/mlx5_user_ioctl_cmds.h>
 #include <rdma/mlx5_user_ioctl_verbs.h>
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
index 2e02bdea8361..0b2dd9eab6a1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
@@ -33,14 +33,18 @@
 #ifndef __MLX5_CORE_H__
 #define __MLX5_CORE_H__
 
-#include <linux/types.h>
+#include <linux/firmware.h>
+#include <linux/if_link.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/if_link.h>
-#include <linux/firmware.h>
+#include <linux/types.h>
+
+#include <net/devlink.h>
+
 #include <linux/mlx5/cq.h>
-#include <linux/mlx5/fs.h>
 #include <linux/mlx5/driver.h>
+#include <linux/mlx5/fs.h>
+
 #include "lib/devcom.h"
 
 extern uint mlx5_core_debug_mask;
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 3475d33c75f4..54b82d55deb6 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -33,28 +33,40 @@
 #ifndef MLX5_DRIVER_H
 #define MLX5_DRIVER_H
 
-#include <linux/kernel.h>
-#include <linux/completion.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/spinlock_types.h>
-#include <linux/semaphore.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/xarray.h>
-#include <linux/workqueue.h>
-#include <linux/mempool.h>
-#include <linux/interrupt.h>
-#include <linux/notifier.h>
-#include <linux/refcount.h>
 #include <linux/auxiliary_bus.h>
-#include <linux/mutex.h>
+#include <linux/completion.h>
+#include <linux/idr.h>
+#include <linux/io.h>
+#include <linux/kref.h>
+#include <linux/lockdep_types.h>
+#include <linux/minmax.h>
+#include <linux/mutex_types.h>
+#include <linux/notifier.h>
+#include <linux/pci.h>
+#include <linux/printk.h>
+#include <linux/refcount.h>
+#include <linux/semaphore.h>
+#include <linux/spinlock_types.h>
+#include <linux/timer_types.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+#include <linux/xarray.h>
+
+#include <net/devlink.h>
+
+#include <rdma/ib_verbs.h>
+
+#include <asm/page.h>
 
 #include <linux/mlx5/device.h>
 #include <linux/mlx5/doorbell.h>
 #include <linux/mlx5/eq.h>
-#include <linux/timecounter.h>
-#include <net/devlink.h>
+
+struct dentry;
+struct device;
+struct dma_pool;
+struct net_device;
+struct pci_dev;
 
 #define MLX5_ADEV_NAME "mlx5_core"
 
@@ -243,6 +255,7 @@ struct mlx5_cmd_first {
 	__be32		data[4];
 };
 
+struct cmd_msg_cache;
 struct mlx5_cmd_msg {
 	struct list_head		list;
 	struct cmd_msg_cache	       *parent;
-- 
2.47.2


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

end of thread, other threads:[~2025-07-13  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-09  8:37 [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers Andy Shevchenko
2025-07-09 22:37 ` Jacob Keller
2025-07-13  2:05 ` kernel test robot

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

all inboxes | Powered by JetHome®