From: Ian Jackson Date: Thu, 6 Oct 2016 11:13:10 +0000 (+0100) Subject: librumpxen_xendev: Make WTROUBLE more anaphoric again X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2f23dc0d5a0e84e91ca7d23b993f36810d9cd198;p=osstest%2Frumprun.git librumpxen_xendev: Make WTROUBLE more anaphoric again In "librumpxen_xendev: xenbus: Reorganise to split minios from rumpkernel parts" WTROUBLE gained an argument for the common struct pointer, because the different call sites did (in that patch) call that struct pointer by different names. Since "librumpxen_xendev: busdev.c: Rename applicable `d' variables to `dc'" the common pointer is always `dc', so WTROUBLE can rely on that again. Signed-off-by: Ian Jackson --- diff --git a/platform/xen/librumpxen_xendev/busdev.c b/platform/xen/librumpxen_xendev/busdev.c index 635a41b..e5d7c7a 100644 --- a/platform/xen/librumpxen_xendev/busdev.c +++ b/platform/xen/librumpxen_xendev/busdev.c @@ -140,7 +140,7 @@ xenbus_dev_write(struct file *fp, off_t *offset, struct uio *uio, break; if (dd->wbuf.msg.len > XENSTORE_PAYLOAD_MAX) - WTROUBLE(dc,"too much payload in packet"); + WTROUBLE("too much payload in packet"); uint32_t packetlen = dd->wbuf.msg.len + sizeof(dd->wbuf.msg); diff --git a/platform/xen/librumpxen_xendev/busdev_user.c b/platform/xen/librumpxen_xendev/busdev_user.c index a839b26..d7935bf 100644 --- a/platform/xen/librumpxen_xendev/busdev_user.c +++ b/platform/xen/librumpxen_xendev/busdev_user.c @@ -236,14 +236,14 @@ rumpxenbus_process_request(struct rumpxenbus_data_common *dc) case XS_SET_PERMS: if (dc->wbuf.msg.tx_id) { if (!find_transaction(dc, dc->wbuf.msg.tx_id)) - WTROUBLE(dc,"unknown transaction"); + WTROUBLE("unknown transaction"); } forward_request(dc, req); break; case XS_TRANSACTION_START: if (dc->wbuf.msg.tx_id) - WTROUBLE(dc,"nested transaction"); + WTROUBLE("nested transaction"); req->u.trans = xbd_malloc(sizeof(*req->u.trans)); if (!req->u.trans) { err = ENOMEM; @@ -254,19 +254,19 @@ rumpxenbus_process_request(struct rumpxenbus_data_common *dc) case XS_TRANSACTION_END: if (!dc->wbuf.msg.tx_id) - WTROUBLE(dc,"ending zero transaction"); + WTROUBLE("ending zero transaction"); req->u.trans = trans = find_transaction(dc, dc->wbuf.msg.tx_id); if (!trans) - WTROUBLE(dc,"ending unknown transaction"); + WTROUBLE("ending unknown transaction"); LIST_REMOVE(trans, entry); /* prevent more reqs using it */ forward_request(dc, req); break; case XS_WATCH: if (dc->wbuf.msg.tx_id) - WTROUBLE(dc,"XS_WATCH with transaction"); + WTROUBLE("XS_WATCH with transaction"); if (!watch_message_parse(&dc->wbuf.msg, &wpath, &wtoken)) - WTROUBLE(dc,"bad XS_WATCH message"); + WTROUBLE("bad XS_WATCH message"); watch = watch_free = xbd_malloc(sizeof(*watch)); if (!watch) { @@ -292,20 +292,20 @@ rumpxenbus_process_request(struct rumpxenbus_data_common *dc) case XS_UNWATCH: if (dc->wbuf.msg.tx_id) - WTROUBLE(dc,"XS_UNWATCH with transaction"); + WTROUBLE("XS_UNWATCH with transaction"); if (!watch_message_parse(&dc->wbuf.msg, &wpath, &wtoken)) - WTROUBLE(dc,"bad XS_WATCH message"); + WTROUBLE("bad XS_WATCH message"); watch = find_visible_watch(dc, wpath, wtoken); if (!watch) - WTROUBLE(dc,"unwatch nonexistent watch"); + WTROUBLE("unwatch nonexistent watch"); watch->visible_to_user = 0; make_watch_request(dc, req, dc->wbuf.msg.tx_id, watch); break; default: - WTROUBLE(dc,"unknown request message type"); + WTROUBLE("unknown request message type"); } err = 0; diff --git a/platform/xen/librumpxen_xendev/busdev_user.h b/platform/xen/librumpxen_xendev/busdev_user.h index 7391c9b..ffbaab8 100644 --- a/platform/xen/librumpxen_xendev/busdev_user.h +++ b/platform/xen/librumpxen_xendev/busdev_user.h @@ -20,9 +20,10 @@ struct rumpxenbus_data_common { }; /* void __NORETURN__ WTROUBLE(const char *details_without_newline); - * assumes: int err; + * assumes: struct rumpxenbus_data_common *dc; + * int err; * end: */ -#define WTROUBLE(dc,s) do{ rumpxenbus_write_trouble((dc),s); err = EINVAL; goto end; }while(0) +#define WTROUBLE(s) do{ rumpxenbus_write_trouble((dc),s); err = EINVAL; goto end; }while(0) void rumpxenbus_write_trouble(struct rumpxenbus_data_common *dc, const char *what);