summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2019-01-10 18:06:57 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2019-01-10 18:06:57 +0000
commitb21bced0ec1a3fcd0d444f29d6b7fe36ed3753ea (patch)
tree6722a5f33c76868769868556c3b8f16db189d24c /sys
parentb7f2e3112b2567cdebe918d846cd7832f84adaee (diff)
Remove some more code if VIRTIO_DEBUG is 0
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pv/virtio.c16
-rw-r--r--sys/dev/pv/virtiovar.h5
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);