From: Daniel Palmer <daniel@thingy.jp>
To: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com,
eperezma@redhat.com
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-m68k@lists.linux-m68k.org, arnd@kernel.org,
Daniel Palmer <daniel@thingy.jp>
Subject: [PATCH 1/2] virtio-mmio: Replace sizeof x with sizeof(x)
Date: Sat, 14 Mar 2026 12:06:10 +0900 [thread overview]
Message-ID: <20260314030612.1949420-2-daniel@thingy.jp> (raw)
In-Reply-To: <20260314030612.1949420-1-daniel@thingy.jp>
checkpatch wants the braces.
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
---
drivers/virtio/virtio_mmio.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 595c2274fbb5..dda915b2ac9f 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -152,21 +152,21 @@ static void vm_get(struct virtio_device *vdev, unsigned int offset,
switch (len) {
case 1:
b = readb(base + offset);
- memcpy(buf, &b, sizeof b);
+ memcpy(buf, &b, sizeof(b));
break;
case 2:
w = cpu_to_le16(readw(base + offset));
- memcpy(buf, &w, sizeof w);
+ memcpy(buf, &w, sizeof(w));
break;
case 4:
l = cpu_to_le32(readl(base + offset));
- memcpy(buf, &l, sizeof l);
+ memcpy(buf, &l, sizeof(l));
break;
case 8:
l = cpu_to_le32(readl(base + offset));
- memcpy(buf, &l, sizeof l);
- l = cpu_to_le32(ioread32(base + offset + sizeof l));
- memcpy(buf + sizeof l, &l, sizeof l);
+ memcpy(buf, &l, sizeof(l));
+ l = cpu_to_le32(ioread32(base + offset + sizeof(l)));
+ memcpy(buf + sizeof(l), &l, sizeof(l));
break;
default:
BUG();
@@ -194,22 +194,22 @@ static void vm_set(struct virtio_device *vdev, unsigned int offset,
switch (len) {
case 1:
- memcpy(&b, buf, sizeof b);
+ memcpy(&b, buf, sizeof(b));
writeb(b, base + offset);
break;
case 2:
- memcpy(&w, buf, sizeof w);
+ memcpy(&w, buf, sizeof(w));
writew(le16_to_cpu(w), base + offset);
break;
case 4:
- memcpy(&l, buf, sizeof l);
+ memcpy(&l, buf, sizeof(l));
writel(le32_to_cpu(l), base + offset);
break;
case 8:
- memcpy(&l, buf, sizeof l);
+ memcpy(&l, buf, sizeof(l));
writel(le32_to_cpu(l), base + offset);
- memcpy(&l, buf + sizeof l, sizeof l);
- writel(le32_to_cpu(l), base + offset + sizeof l);
+ memcpy(&l, buf + sizeof(l), sizeof(l));
+ writel(le32_to_cpu(l), base + offset + sizeof(l));
break;
default:
BUG();
--
2.51.0
next prev parent reply other threads:[~2026-03-14 3:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 3:06 [PATCH 0/2] Allow virtio-mmio to work on m68k nommu 68000 Daniel Palmer
2026-03-14 3:06 ` Daniel Palmer [this message]
2026-03-14 3:06 ` [PATCH 2/2] virtio-mmio: Use raw io accessors to avoid arch issues Daniel Palmer
2026-03-14 7:42 ` Arnd Bergmann
2026-03-14 8:32 ` Daniel Palmer
2026-03-14 15:06 ` Arnd Bergmann
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=20260314030612.1949420-2-daniel@thingy.jp \
--to=daniel@thingy.jp \
--cc=arnd@kernel.org \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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