mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Leon Romanovsky <leon@kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>,
	Shahar Shitrit <shshitrit@nvidia.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers
Date: Wed,  9 Jul 2025 11:37:41 +0300	[thread overview]
Message-ID: <20250709083757.181265-1-andriy.shevchenko@linux.intel.com> (raw)

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


             reply	other threads:[~2025-07-09  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09  8:37 Andy Shevchenko [this message]
2025-07-09 22:37 ` Jacob Keller
2025-07-13  2:05 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250709083757.181265-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=shshitrit@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®