]> git.baikalelectronics.ru Git - kernel.git/commit
gro: simplify gro_list_prepare()
authorAlexander Lobakin <alobakin@pm.me>
Sat, 13 Mar 2021 20:30:05 +0000 (20:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 14 Mar 2021 21:41:08 +0000 (14:41 -0700)
commit7fd2e71c1a3b813b1aed14ffdeb96d2ee5bc8067
tree817fd9202857df9590a1fb7da4e66e47c80a99f5
parent31d9be50cac2205b0e7c8f6b2af9f96834cca3b4
gro: simplify gro_list_prepare()

gro_list_prepare() always returns &napi->gro_hash[bucket].list,
without any variations. Moreover, it uses 'napi' argument only to
have access to this list, and calculates the bucket index for the
second time (firstly it happens at the beginning of
dev_gro_receive()) to do that.
Given that dev_gro_receive() already has an index to the needed
list, just pass it as the first argument to eliminate redundant
calculations, and make gro_list_prepare() return void.
Also, both arguments of gro_list_prepare() can be constified since
this function can only modify the skbs from the bucket list.

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c