From: Jack Wallner <jackwallner@gmail.com>
To: Kees Cook <kees@kernel.org>
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
Sunil Goutham <sgoutham@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
Ratheesh Kannoth <rkannoth@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: [PATCH 5/8] octeontx2-pf: Use ALIGN() on a DMA address
Date: Sun, 29 Nov 2026 00:56:07 -0800 [thread overview]
Message-ID: <20261129085612.22266-6-jackwallner@gmail.com> (raw)
In-Reply-To: <20261129085612.22266-1-jackwallner@gmail.com>
PTR_ALIGN() is meant for pointers. cn10k_outb_cptlf_iq_alloc() passes it
a dma_addr_t. That compiles because PTR_ALIGN() casts its argument to
unsigned long and back.
A later patch in this series makes PTR_ALIGN() do pointer arithmetic on
its argument so that the compiler can keep track of the object size,
and documents that the argument has to be a pointer. Use ALIGN() for
this address, which works in the type of its argument.
No functional change: the driver depends on 64BIT, where both macros
give the same value.
Compile tested only.
The change and this changelog were written by an AI coding assistant
(Claude, run in Claude Code) at my direction. See the cover letter for
how it was used and tested.
Signed-off-by: Jack Wallner <jackwallner@gmail.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
index 443435608..7ba0f4a28 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
@@ -248,7 +248,7 @@ static int cn10k_outb_cptlf_iq_alloc(struct otx2_nic *pf)
/* Align pointers */
iq->vaddr = PTR_ALIGN(iq->vaddr, OTX2_ALIGN);
- iq->dma_addr = PTR_ALIGN(iq->dma_addr, OTX2_ALIGN);
+ iq->dma_addr = ALIGN(iq->dma_addr, OTX2_ALIGN);
return 0;
}
--
2.43.0
prev parent reply other threads:[~2026-11-29 8:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 8:56 [PATCH 0/8] Preserve object size through PTR_ALIGN() Jack Wallner
2026-11-29 8:56 ` [PATCH 4/8] be2net: Use ALIGN() on a DMA address Jack Wallner
2026-11-29 8:56 ` Jack Wallner [this message]
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=20261129085612.22266-6-jackwallner@gmail.com \
--to=jackwallner@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=gakula@marvell.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rkannoth@marvell.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/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