diff mbox series

[net-next] netxen_nic: Use {low,upp}er_32_bits() helpers

Message ID 319d4a5313ac75f7bbbb6b230b6802b18075c3e0.1720430602.git.geert+renesas@glider.be (mailing list archive)
State Accepted
Commit 40ab9e0dc86535acebe78ee3d38c576bc932df78
Delegated to: Netdev Maintainers
Headers show
Series [net-next] netxen_nic: Use {low,upp}er_32_bits() helpers | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 816 this patch: 816
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 821 this patch: 821
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 822 this patch: 822
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-08--15-00 (tests: 694)

Commit Message

Geert Uytterhoeven July 8, 2024, 9:25 a.m. UTC
Use the existing {low,upp}er_32_bits() helpers instead of defining
custom variants.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested on 32 and 64 bit.
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Simon Horman July 8, 2024, 11:05 a.m. UTC | #1
On Mon, Jul 08, 2024 at 11:25:14AM +0200, Geert Uytterhoeven wrote:
> Use the existing {low,upp}er_32_bits() helpers instead of defining
> custom variants.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Hi Geert,

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

Reviewed-by: Simon Horman <horms@kernel.org>

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.

...
patchwork-bot+netdevbpf@kernel.org July 10, 2024, 2:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> 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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
index 2fcbcecb41d17a34..fef4b2b0b1f268dd 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
@@ -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;