summaryrefslogtreecommitdiff
path: root/sys/dev/pv/hyperv.c
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-11-02 19:56:26 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-11-02 19:56:26 +0000
commit8844a1430b7b3807bb1a95ef464434b771be5434 (patch)
tree65010642a8ebcd7107ede2e52326024b42f04360 /sys/dev/pv/hyperv.c
parent6033ebc1f550052a4521cd8a0a02eac8511ef52d (diff)
Inline the macro that is used only once
Diffstat (limited to 'sys/dev/pv/hyperv.c')
-rw-r--r--sys/dev/pv/hyperv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pv/hyperv.c b/sys/dev/pv/hyperv.c
index 205552beb9d..d3c439e5a1c 100644
--- a/sys/dev/pv/hyperv.c
+++ b/sys/dev/pv/hyperv.c
@@ -1229,9 +1229,6 @@ hv_ring_get(struct hv_ring_data *rrd, uint8_t *data, uint32_t datalen,
}
}
-#define HV_BYTES_AVAIL_TO_WRITE(r, w, z) \
- ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))
-
static inline void
hv_ring_avail(struct hv_ring_data *rd, uint32_t *towrite, uint32_t *toread)
{
@@ -1239,7 +1236,10 @@ hv_ring_avail(struct hv_ring_data *rd, uint32_t *towrite, uint32_t *toread)
uint32_t widx = rd->rd_ring->br_windex;
uint32_t r, w;
- w = HV_BYTES_AVAIL_TO_WRITE(ridx, widx, rd->rd_data_size);
+ if (widx >= ridx)
+ w = rd->rd_data_size - (widx - ridx);
+ else
+ w = ridx - widx;
r = rd->rd_data_size - w;
if (towrite)
*towrite = w;
@@ -1499,7 +1499,7 @@ hv_handle_alloc(struct hv_channel *ch, void *buffer, uint32_t buflen,
}
msg->msg_req.hc_dsize = sizeof(struct vmbus_chanmsg_gpadl_conn) +
- /* sizeof(struct vmbus_gpa_range) */ + inhdr * sizeof(uint64_t);
+ inhdr * sizeof(uint64_t);
hdr = (struct vmbus_chanmsg_gpadl_conn *)msg->msg_req.hc_data;
msg->msg_rsp = &rsp;
msg->msg_rsplen = sizeof(rsp);