[PATCH RFC 01/10] IB/core: Prepare for immutable device groups

Heiner Kallweit posted 10 patches 1 month, 2 weeks ago
[PATCH RFC 01/10] IB/core: Prepare for immutable device groups
Posted by Heiner Kallweit 1 month, 2 weeks ago
This prepares for making struct device member groups a constant array.
No functional change intended.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/infiniband/core/device.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 1174ab7da62..f967ad534fc 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -565,15 +565,14 @@ static void rdma_init_coredev(struct ib_core_device *coredev,
 	 */
 	BUILD_BUG_ON(offsetof(struct ib_device, coredev.dev) !=
 		     offsetof(struct ib_device, dev));
-
-	coredev->dev.class = &ib_class;
-	coredev->dev.groups = dev->groups;
-
 	/*
 	 * Don't expose hw counters outside of the init namespace.
 	 */
 	if (!is_full_dev && dev->hw_stats_attr_index)
-		coredev->dev.groups[dev->hw_stats_attr_index] = NULL;
+		dev->groups[dev->hw_stats_attr_index] = NULL;
+
+	coredev->dev.class = &ib_class;
+	coredev->dev.groups = dev->groups;
 
 	device_initialize(&coredev->dev);
 	coredev->owner = dev;
-- 
2.53.0
Re: [PATCH RFC 01/10] IB/core: Prepare for immutable device groups
Posted by Leon Romanovsky 1 month, 1 week ago
On Tue, Feb 17, 2026 at 11:25:20PM +0100, Heiner Kallweit wrote:
> This prepares for making struct device member groups a constant array.
> No functional change intended.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/infiniband/core/device.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 

Thanks,
Acked-by: Leon Romanovsky <leon@kernel.org>