Skip to contentSkip to conversation

netxen_nic: Use {low,upp}er_32_bits() helpers

PATCH Applied Geert Uytterhoeven 3 participants 3 messages Jul 8, 2024 – Jul 10, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netxen_nic: Use {low,upp}er_32_bits() helpers

Use the existing {low,upp}er_32_bits() helpers instead of defining custom variants.

---
Compile-tested on 32 and 64 bit.

---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c +2 -5
index 2fcbcecb41d17a34..fef4b2b0b1f268dd 100644
@@ -571,9 +571,6 @@ static u64 ctx_addr_sig_regs[][3] = {
 #define CRB_CTX_ADDR_REG_HI(FUNC_ID)	(ctx_addr_sig_regs[FUNC_ID][2])
 #define CRB_CTX_SIGNATURE_REG(FUNC_ID)	(ctx_addr_sig_regs[FUNC_ID][1])
 
-#define lower32(x)	((u32)((x) & 0xffffffff))
-#define upper32(x)	((u32)(((u64)(x) >> 32) & 0xffffffff))
-
 static struct netxen_recv_crb recv_crb_registers[] = {
 	/* Instance 0 */
 	{
@@ -723,9 +720,9 @@ netxen_init_old_ctx(struct netxen_adapter *adapter)
 		NETXEN_CTX_SIGNATURE_V2 : NETXEN_CTX_SIGNATURE;
 
 	NXWR32(adapter, CRB_CTX_ADDR_REG_LO(port),
-			lower32(recv_ctx->phys_addr));
+			lower_32_bits(recv_ctx->phys_addr));
 	NXWR32(adapter, CRB_CTX_ADDR_REG_HI(port),
-			upper32(recv_ctx->phys_addr));
+			upper_32_bits(recv_ctx->phys_addr));
 	NXWR32(adapter, CRB_CTX_SIGNATURE_REG(port),
 			signature | port);
 	return 0;
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Geert Uytterhoeven

Use the existing {low,upp}er_32_bits() helpers instead of defining custom variants.

Hi Geert,

I agree your patch is a good cleanup, so from that PoV.

But it also also seems to me that the last non-cleanup fix this patch received was the following commit in May 2012, which was included in v4.0.

commit 01da0c2b0391 ("netxen_nic: Fix estimation of recv MSS in case of LRO")

So I do wonder if rather than cleaning up this driver, we should discuss if it should be removed.

...

#2 lore raw
In reply to Geert Uytterhoeven
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 8 Jul 2024 11:25:14 +0200 you wrote:

Use the existing {low,upp}er_32_bits() helpers instead of defining custom variants.

---
Compile-tested on 32 and 64 bit.

[...]

Here is the summary with links:
- [net-next] netxen_nic: Use {low,upp}er_32_bits() helpers

    https://git.kernel.org/netdev/net-next/c/40ab9e0dc865

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html