* [PATCH nf-next] netfilter: Remove redundant NFCT_ALIGN call
@ 2025-04-04 9:47 Xuanqiang Luo
2025-04-04 12:41 ` Florian Westphal
2025-04-15 15:40 ` Pablo Neira Ayuso
0 siblings, 2 replies; 3+ messages in thread
From: Xuanqiang Luo @ 2025-04-04 9:47 UTC (permalink / raw)
To: netfilter-devel, pablo, fw, davem; +Cc: Xuanqiang Luo, Xuanqiang Luo
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
The "nf_ct_tmpl_alloc" function had a redundant call to "NFCT_ALIGN" when
aligning the pointer "p". Since "NFCT_ALIGN" always gives the same result
for the same input.
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
---
net/netfilter/nf_conntrack_core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 7f8b245e287a..de8d50af9b5b 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -531,10 +531,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net,
p = tmpl;
tmpl = (struct nf_conn *)NFCT_ALIGN((unsigned long)p);
- if (tmpl != p) {
- tmpl = (struct nf_conn *)NFCT_ALIGN((unsigned long)p);
+ if (tmpl != p)
tmpl->proto.tmpl_padto = (char *)tmpl - (char *)p;
- }
} else {
tmpl = kzalloc(sizeof(*tmpl), flags);
if (!tmpl)
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nf-next] netfilter: Remove redundant NFCT_ALIGN call
2025-04-04 9:47 [PATCH nf-next] netfilter: Remove redundant NFCT_ALIGN call Xuanqiang Luo
@ 2025-04-04 12:41 ` Florian Westphal
2025-04-15 15:40 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2025-04-04 12:41 UTC (permalink / raw)
To: Xuanqiang Luo; +Cc: netfilter-devel, pablo, fw, davem, Xuanqiang Luo
Xuanqiang Luo <xuanqiang.luo@linux.dev> wrote:
> From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
>
> The "nf_ct_tmpl_alloc" function had a redundant call to "NFCT_ALIGN" when
> aligning the pointer "p". Since "NFCT_ALIGN" always gives the same result
> for the same input.
Acked-by: Florian Westphal <fw@strlen.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nf-next] netfilter: Remove redundant NFCT_ALIGN call
2025-04-04 9:47 [PATCH nf-next] netfilter: Remove redundant NFCT_ALIGN call Xuanqiang Luo
2025-04-04 12:41 ` Florian Westphal
@ 2025-04-15 15:40 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2025-04-15 15:40 UTC (permalink / raw)
To: Xuanqiang Luo; +Cc: netfilter-devel, fw, davem, Xuanqiang Luo
On Fri, Apr 04, 2025 at 05:47:51PM +0800, Xuanqiang Luo wrote:
> From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
>
> The "nf_ct_tmpl_alloc" function had a redundant call to "NFCT_ALIGN" when
> aligning the pointer "p". Since "NFCT_ALIGN" always gives the same result
> for the same input.
Applied to nf-next, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-15 15:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04 9:47 [PATCH nf-next] netfilter: Remove redundant NFCT_ALIGN call Xuanqiang Luo
2025-04-04 12:41 ` Florian Westphal
2025-04-15 15:40 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.