OSDN Git Service

virtio-mem: Don't rely on implicit compiler padding for requests
authorDavid Hildenbrand <david@redhat.com>
Fri, 15 May 2020 10:14:02 +0000 (12:14 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 4 Jun 2020 19:36:52 +0000 (15:36 -0400)
commitfce8afd76e3a4d8c59c92f84f8027569fd7031d0
tree6e8a0d9ba7798b86e0f71b822948a29866361210
parent72f9525ad76b1ddfe663285805982e9d57c7b2c2
virtio-mem: Don't rely on implicit compiler padding for requests

The compiler will add padding after the last member, make that explicit.
The size of a request is always 24 bytes. The size of a response always
10 bytes. Add compile-time checks.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: teawater <teawaterz@linux.alibaba.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20200515101402.16597-1-david@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mem.c
include/uapi/linux/virtio_mem.h