# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/02/3431904
- Thread: https://ratatoskr.run/netdev/2026/02/3428362/t.md

```text
> +++ 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?

> +static inline u32 rd32(u8 __iomem *addr, u64 reg)
> +{
> +	return readl(addr + (reg));
> +}

Why () around reg?

> +
> +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
```
