ethernet: s2io: Use skb_put_data() instead of skb_put/memcpy pair
Subsystems (2)
PATCH 1/1 ethernet: s2io: Use skb_put_data() instead of skb_put/memcpy pair
Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Drop the tmp variable that is not needed any more.
Signed-off-by Shang XiaoJing <[email protected]>
--- drivers/net/ethernet/neterion/s2io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/neterion/s2io.c +1 -2
@@ -7359,10 +7359,9 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)int get_off = ring_data->rx_curr_get_info.offset;int buf0_len =RXD_GET_BUFFER0_SIZE_3 (rxdp->Control_2);int buf2_len =RXD_GET_BUFFER2_SIZE_3 (rxdp->Control_2); -unsigned char *buff =skb_push (skb, buf0_len);struct buffAdd *ba = &ring_data->ba[get_block][get_off]; -memcpy (buff, ba->ba_0, buf0_len); +skb_put_data (skb, ba->ba_0, buf0_len);skb_put (skb, buf2_len); }
Signature · 1 line
2.17.1
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:
Quoted 7 lines · On Tue, 27 Sep 2022 10:28:02 +0800 you wrote:
Use
skb_put_data()instead ofskb_put()andmemcpy(), which is shorter and clear. Drop the tmp variable that is not needed any more.Signed-off-by Shang XiaoJing <[email protected]>--- drivers/net/ethernet/neterion/s2io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Here is the summary with links:
- [-next] ethernet: s2io: Use skb_put_data() instead of skb_put/memcpy pair
https://git.kernel.org/netdev/net-next/c/1469327bb3dd
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html