* [PATCH net-next] net: remove redundant check in skb_shift()
@ 2024-08-15 14:09 Zhang Changzhong
2024-08-16 10:49 ` Simon Horman
2024-08-20 1:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Zhang Changzhong @ 2024-08-15 14:09 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Zhang Changzhong, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
The check for '!to' is redundant here, since skb_can_coalesce() already
contains this check.
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
net/core/skbuff.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 83f8cd8..f915234 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4169,8 +4169,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
/* Actual merge is delayed until the point when we know we can
* commit all, so that we don't have to undo partial changes
*/
- if (!to ||
- !skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
+ if (!skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
skb_frag_off(fragfrom))) {
merge = -1;
} else {
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: remove redundant check in skb_shift()
2024-08-15 14:09 [PATCH net-next] net: remove redundant check in skb_shift() Zhang Changzhong
@ 2024-08-16 10:49 ` Simon Horman
2024-08-20 1:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-08-16 10:49 UTC (permalink / raw)
To: Zhang Changzhong
Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
On Thu, Aug 15, 2024 at 10:09:42PM +0800, Zhang Changzhong wrote:
> The check for '!to' is redundant here, since skb_can_coalesce() already
> contains this check.
It would be nice to mention here how this was found (e.g. found by
inspection, flagged by private static analysis tool, ...) and how it was
tested (e.g. compile tested only).
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
In any case, this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: remove redundant check in skb_shift()
2024-08-15 14:09 [PATCH net-next] net: remove redundant check in skb_shift() Zhang Changzhong
2024-08-16 10:49 ` Simon Horman
@ 2024-08-20 1:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-20 1:30 UTC (permalink / raw)
To: Zhang Changzhong; +Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 15 Aug 2024 22:09:42 +0800 you wrote:
> The check for '!to' is redundant here, since skb_can_coalesce() already
> contains this check.
>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> ---
> net/core/skbuff.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Here is the summary with links:
- [net-next] net: remove redundant check in skb_shift()
https://git.kernel.org/netdev/net-next/c/dca9d62a0d76
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-20 1:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 14:09 [PATCH net-next] net: remove redundant check in skb_shift() Zhang Changzhong
2024-08-16 10:49 ` Simon Horman
2024-08-20 1:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).