linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] visornic: use skb_put_zero() instead of open-coded version
@ 2019-02-15 18:16 Jann Horn
  0 siblings, 0 replies; only message in thread
From: Jann Horn @ 2019-02-15 18:16 UTC (permalink / raw)
  To: David Kershner, sparmaintainer, jannh
  Cc: Greg Kroah-Hartman, linux-kernel, netdev

Replace an open-coded version of skb_put_zero() with a call to the helper.
This is a cleanup and is also useful for potentially adding KASAN
integration to SKBs in the future.

Signed-off-by: Jann Horn <jannh@google.com>
---
 drivers/staging/unisys/visornic/visornic_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 5eeb4b93b45b..1c1a470d2e50 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -896,9 +896,7 @@ static netdev_tx_t visornic_xmit(struct sk_buff *skb, struct net_device *netdev)
 	    ((skb_end_pointer(skb) - skb->data) >= ETH_MIN_PACKET_SIZE)) {
 		/* pad the packet out to minimum size */
 		padlen = ETH_MIN_PACKET_SIZE - len;
-		memset(&skb->data[len], 0, padlen);
-		skb->tail += padlen;
-		skb->len += padlen;
+		skb_put_zero(skb, padlen);
 		len += padlen;
 		firstfraglen += padlen;
 	}
-- 
2.21.0.rc0.258.g878e2cd30e-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-15 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 18:16 [PATCH] visornic: use skb_put_zero() instead of open-coded version Jann Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).