public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: "Michael S. Tsirkin" <mst@redhat•com>
Cc: netdev@vger•kernel.org, Stephen Hemminger <stephen@networkplumber•org>
Subject: [PATCH net-next 2/3] virtio: cleanup sizeof usage
Date: Tue, 26 Jul 2016 09:20:10 -0700	[thread overview]
Message-ID: <20160726162036.179433604@networkplumber.org> (raw)
In-Reply-To: 20160726162008.310530368@networkplumber.org

[-- Attachment #1: virtio-sizeof.patch --]
[-- Type: text/plain, Size: 551 bytes --]

Although sizeof is an operator in C. Preferred usage is to use
it as a function.

Signed-off-by: Stephen Hemminger <stephen@networkplumber•org>

--- a/drivers/net/virtio_net.c	2016-07-26 09:13:16.173384238 -0700
+++ b/drivers/net/virtio_net.c	2016-07-26 09:13:16.169384220 -0700
@@ -272,7 +272,7 @@ static struct sk_buff *page_to_skb(struc
 
 	hdr_len = vi->hdr_len;
 	if (vi->mergeable_rx_bufs)
-		hdr_padded_len = sizeof *hdr;
+		hdr_padded_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
 	else
 		hdr_padded_len = sizeof(struct padded_vnet_hdr);
 

  parent reply	other threads:[~2016-07-26 16:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 16:20 [PATCH net-next 0/3] virtio: style cleanups Stephen Hemminger
2016-07-26 16:20 ` [PATCH net-next 1/3] virtio: whitespace cleanups Stephen Hemminger
2016-07-26 16:20 ` Stephen Hemminger [this message]
2016-07-26 16:20 ` [PATCH net-next 3/3] virtio: use kcalloc and kmalloc_array Stephen Hemminger
2016-07-26 16:34   ` Nikolay Aleksandrov
2016-07-26 16:34   ` Michael S. Tsirkin
2016-07-26 16:35   ` Stephen Hemminger
2016-07-26 18:05     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160726162036.179433604@networkplumber.org \
    --to=stephen@networkplumber$(echo .)org \
    --cc=mst@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox