]> 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>
Wed, 18 Sep 2024 17:24:05 +0000 (19:24 +0200)
commit9569e1fd06fa94cd95df72f613a73ffac3f9e4fd
tree47fa18a1928b62347ac4d2ceefc92451ec2c76e1
parent28123a54f8877ae21f9b40b5e7b38832c6fac7b3
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