]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ethernet: use ip_hdrlen() instead of bit shift
authorMoon Yeounsu <yyyynoom@gmail.com>
Wed, 7 Aug 2024 10:07:21 +0000 (19:07 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:10:32 +0000 (15:10 +0200)
commit9ef29b75f5f9c17b92b7347d7dab5ee797825a38
treed2c720bfbad06b134baa5ffeaf18ce21ebf67114
parentd71c5e8cbcf9ced0765f99fd669da2610088e08e
net: ethernet: use ip_hdrlen() instead of bit shift

[ Upstream commit 9a039eeb71a42c8b13408a1976e300f3898e1be0 ]

`ip_hdr(skb)->ihl << 2` is the same as `ip_hdrlen(skb)`
Therefore, we should use a well-defined function not a bit shift
to find the header length.

It also compresses two lines to a single line.

Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com>
Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/jme.c