From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] net: r8169: use lower/upper_32_bits for clarity
Date: Mon, 14 Oct 2024 13:52:31 +0200 [thread overview]
Message-ID: <20241014115232.2846257-1-a.fatoum@pengutronix.de> (raw)
No functional difference, but the code is much more readable without the
casts and shifts.
Additional benefit is removing the strange use of DMA_BIT_MASK here.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/net/r8169_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/r8169_main.c b/drivers/net/r8169_main.c
index cd45677131ab..2d895cf88b43 100644
--- a/drivers/net/r8169_main.c
+++ b/drivers/net/r8169_main.c
@@ -1542,10 +1542,10 @@ static void rtl_set_rx_tx_desc_registers(struct rtl8169_private *tp)
* register to be written before TxDescAddrLow to work.
* Switching from MMIO to I/O access fixes the issue as well.
*/
- RTL_W32(tp, TxDescStartAddrHigh, ((u64) tp->TxPhyAddr) >> 32);
- RTL_W32(tp, TxDescStartAddrLow, ((u64) tp->TxPhyAddr) & DMA_BIT_MASK(32));
- RTL_W32(tp, RxDescAddrHigh, ((u64) tp->RxPhyAddr) >> 32);
- RTL_W32(tp, RxDescAddrLow, ((u64) tp->RxPhyAddr) & DMA_BIT_MASK(32));
+ RTL_W32(tp, TxDescStartAddrHigh, upper_32_bits(tp->TxPhyAddr));
+ RTL_W32(tp, TxDescStartAddrLow, lower_32_bits(tp->TxPhyAddr));
+ RTL_W32(tp, RxDescAddrHigh, upper_32_bits(tp->RxPhyAddr));
+ RTL_W32(tp, RxDescAddrLow, lower_32_bits(tp->RxPhyAddr));
}
static void rtl8169_set_magic_reg(struct rtl8169_private *tp)
--
2.39.5
next reply other threads:[~2024-10-14 13:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 11:52 Ahmad Fatoum [this message]
2024-10-14 11:52 ` [PATCH 2/2] usb: gadget: fix static analysis false positive Ahmad Fatoum
2024-10-15 7:19 ` [PATCH 1/2] net: r8169: use lower/upper_32_bits for clarity Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241014115232.2846257-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox