summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-03-29 09:45:05 +0000
committerriastradh <riastradh@NetBSD.org>2023-03-29 09:45:05 +0000
commit601987ca7861ae092e77e76dfb14f5abbc035f35 (patch)
treed19d06993c7c2386b289c3a5819d26a2bdefe085 /sys/dev
parent78bb5a5eff4435db6e6022e3a3b6f6ff0322703b (diff)
virtio(4): Use flexible array members, not zero-length arrays.
This enables the compiler to detect sizeof mistakes like PR kern/57304.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/virtioreg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/virtioreg.h b/sys/dev/pci/virtioreg.h
index ea4435701ff..a28069343a8 100644
--- a/sys/dev/pci/virtioreg.h
+++ b/sys/dev/pci/virtioreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: virtioreg.h,v 1.11 2022/10/15 20:00:35 riastradh Exp $ */
+/* $NetBSD: virtioreg.h,v 1.12 2023/03/29 09:45:05 riastradh Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -153,7 +153,7 @@ struct vring_desc {
struct vring_avail {
uint16_t flags;
uint16_t idx;
- uint16_t ring[0];
+ uint16_t ring[];
/* trailed by uint16_t used_event when VIRTIO_F_RING_EVENT_IDX */
} __packed;
@@ -168,7 +168,7 @@ struct vring_used_elem {
struct vring_used {
uint16_t flags;
uint16_t idx;
- struct vring_used_elem ring[0];
+ struct vring_used_elem ring[];
/* trailed by uint16_t avail_event when VIRTIO_F_RING_EVENT_IDX */
} __packed;