Re: [PATCH v5 net-next 02/11] net/nebula-matrix: add our driver architecture

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-02-27 22:47:02
Also in
linux-doc, lkml
Reply to
illusion.wang, 2026-02-26
quoted hunk ↗ jump to hunk
+++ b/drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2025 Nebula Matrix Limited.
+ * Author:
+ */
+
+#include "nbl_hw_leonis.h"
+
+static struct nbl_hw_ops hw_ops = {
+	if (param->caps.has_ctrl) {
+		hw_mgt->hw_addr =
+			ioremap(pci_resource_start(pdev, NBL_MEMORY_BAR),
+				pci_resource_len(pdev, NBL_MEMORY_BAR) -
+					NBL_RDMA_NOTIFY_OFF);
Where is the include of linux/io.h needed for this?
+	spin_lock_init(&hw_mgt->reg_lock);
linux/spinlock.h?
quoted hunk ↗ jump to hunk
+static inline u32 rd32(u8 __iomem *addr, u64 reg)
+{
+	return readl(addr + (reg));
+}
Why () around reg?
quoted hunk ↗ jump to hunk
+
+static inline void wr32(u8 __iomem *addr, u64 reg, u32 value)
+{
+	writel((value), (addr + (reg)));
+}
Why () around value? These are functions, not macros, so there cannot
be any side effects.


    Andrew

---
pw-bot: cr
Thread (24 messages) 24 messages, 2 authors, last reply 2026-03-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help