Module Name: src Committed By: riastradh Date: Wed Mar 29 09:45:05 UTC 2023
Modified Files: src/sys/dev/pci: virtioreg.h Log Message: virtio(4): Use flexible array members, not zero-length arrays. This enables the compiler to detect sizeof mistakes like PR kern/57304. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/virtioreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/virtioreg.h diff -u src/sys/dev/pci/virtioreg.h:1.11 src/sys/dev/pci/virtioreg.h:1.12 --- src/sys/dev/pci/virtioreg.h:1.11 Sat Oct 15 20:00:35 2022 +++ src/sys/dev/pci/virtioreg.h Wed Mar 29 09:45:05 2023 @@ -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;