diff options
author | 2019-01-10 18:06:56 +0000 | |
---|---|---|
committer | 2019-01-10 18:06:56 +0000 | |
commit | e578ff6a84edc484b5f54b7207fe128452a8a63b (patch) | |
tree | 9bafb7b72a380395773d2811c992318190191dd9 | |
parent | Move some common defines to virtiovar.h (diff) | |
download | wireguard-openbsd-e578ff6a84edc484b5f54b7207fe128452a8a63b.tar.xz wireguard-openbsd-e578ff6a84edc484b5f54b7207fe128452a8a63b.zip |
Remove some more code if VIRTIO_DEBUG is 0
-rw-r--r-- | sys/dev/pv/virtio.c | 16 | ||||
-rw-r--r-- | sys/dev/pv/virtiovar.h | 5 |
2 files changed, 11 insertions, 10 deletions
diff --git a/sys/dev/pv/virtio.c b/sys/dev/pv/virtio.c index f6293583d43..e6cd1ace5aa 100644 --- a/sys/dev/pv/virtio.c +++ b/sys/dev/pv/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.12 2019/01/10 18:05:43 sf Exp $ */ +/* $OpenBSD: virtio.c,v 1.13 2019/01/10 18:06:56 sf Exp $ */ /* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */ /* @@ -68,6 +68,13 @@ static const char * const virtio_device_name[] = { }; #define NDEVNAMES (sizeof(virtio_device_name)/sizeof(char*)) +const char * +virtio_device_string(int id) +{ + return id < NDEVNAMES ? virtio_device_name[id] : "Unknown"; +} + +#if VIRTIO_DEBUG static const struct virtio_feature_name transport_feature_names[] = { { VIRTIO_F_NOTIFY_ON_EMPTY, "NotifyOnEmpty"}, { VIRTIO_F_RING_INDIRECT_DESC, "RingIndirectDesc"}, @@ -76,12 +83,6 @@ static const struct virtio_feature_name transport_feature_names[] = { { 0, NULL} }; -const char * -virtio_device_string(int id) -{ - return id < NDEVNAMES ? virtio_device_name[id] : "Unknown"; -} - void virtio_log_features(uint32_t host, uint32_t neg, const struct virtio_feature_name *guest_feature_names) @@ -113,6 +114,7 @@ virtio_log_features(uint32_t host, uint32_t neg, printf(" %cUnknown(%d)", c, i); } } +#endif /* * Reset the device. diff --git a/sys/dev/pv/virtiovar.h b/sys/dev/pv/virtiovar.h index 3714f5cdf1f..0c353a8f177 100644 --- a/sys/dev/pv/virtiovar.h +++ b/sys/dev/pv/virtiovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: virtiovar.h,v 1.8 2019/01/10 18:05:43 sf Exp $ */ +/* $OpenBSD: virtiovar.h,v 1.9 2019/01/10 18:06:56 sf Exp $ */ /* $NetBSD: virtiovar.h,v 1.1 2011/10/30 12:12:21 hannken Exp $ */ /* @@ -219,9 +219,8 @@ void virtio_stop_vq_intr(struct virtio_softc *, struct virtqueue *); int virtio_start_vq_intr(struct virtio_softc *, struct virtqueue *); const char *virtio_device_string(int); -void virtio_log_features(uint32_t, uint32_t, const struct virtio_feature_name *); - #if VIRTIO_DEBUG +void virtio_log_features(uint32_t, uint32_t, const struct virtio_feature_name *); void virtio_vq_dump(struct virtqueue *vq); #endif int virtio_nused(struct virtqueue *vq); |