From: Shang XiaoJing Date: Tue, 27 Sep 2022 02:28:02 +0000 (+0800) Subject: ethernet: s2io: Use skb_put_data() instead of skb_put/memcpy pair X-Git-Tag: v6.1-rc5~319^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1469327bb3dd04c0c84692e9af930bdd3f7b4230;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/20220927022802.16050-1-shangxiaojing@huawei.com Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c index 804354e..dcf8212 100644 --- a/drivers/net/ethernet/neterion/s2io.c +++ b/drivers/net/ethernet/neterion/s2io.c @@ -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); }