Skip to content

Commit 2f23dc0

Browse files
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 <Ian.Jackson@eu.citrix.com>
1 parent b3d9b30 commit 2f23dc0

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

platform/xen/librumpxen_xendev/busdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ xenbus_dev_write(struct file *fp, off_t *offset, struct uio *uio,
140140
break;
141141

142142
if (dd->wbuf.msg.len > XENSTORE_PAYLOAD_MAX)
143-
WTROUBLE(dc,"too much payload in packet");
143+
WTROUBLE("too much payload in packet");
144144

145145
uint32_t packetlen =
146146
dd->wbuf.msg.len + sizeof(dd->wbuf.msg);

platform/xen/librumpxen_xendev/busdev_user.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ rumpxenbus_process_request(struct rumpxenbus_data_common *dc)
236236
case XS_SET_PERMS:
237237
if (dc->wbuf.msg.tx_id) {
238238
if (!find_transaction(dc, dc->wbuf.msg.tx_id))
239-
WTROUBLE(dc,"unknown transaction");
239+
WTROUBLE("unknown transaction");
240240
}
241241
forward_request(dc, req);
242242
break;
243243

244244
case XS_TRANSACTION_START:
245245
if (dc->wbuf.msg.tx_id)
246-
WTROUBLE(dc,"nested transaction");
246+
WTROUBLE("nested transaction");
247247
req->u.trans = xbd_malloc(sizeof(*req->u.trans));
248248
if (!req->u.trans) {
249249
err = ENOMEM;
@@ -254,19 +254,19 @@ rumpxenbus_process_request(struct rumpxenbus_data_common *dc)
254254

255255
case XS_TRANSACTION_END:
256256
if (!dc->wbuf.msg.tx_id)
257-
WTROUBLE(dc,"ending zero transaction");
257+
WTROUBLE("ending zero transaction");
258258
req->u.trans = trans = find_transaction(dc, dc->wbuf.msg.tx_id);
259259
if (!trans)
260-
WTROUBLE(dc,"ending unknown transaction");
260+
WTROUBLE("ending unknown transaction");
261261
LIST_REMOVE(trans, entry); /* prevent more reqs using it */
262262
forward_request(dc, req);
263263
break;
264264

265265
case XS_WATCH:
266266
if (dc->wbuf.msg.tx_id)
267-
WTROUBLE(dc,"XS_WATCH with transaction");
267+
WTROUBLE("XS_WATCH with transaction");
268268
if (!watch_message_parse(&dc->wbuf.msg, &wpath, &wtoken))
269-
WTROUBLE(dc,"bad XS_WATCH message");
269+
WTROUBLE("bad XS_WATCH message");
270270

271271
watch = watch_free = xbd_malloc(sizeof(*watch));
272272
if (!watch) {
@@ -292,20 +292,20 @@ rumpxenbus_process_request(struct rumpxenbus_data_common *dc)
292292

293293
case XS_UNWATCH:
294294
if (dc->wbuf.msg.tx_id)
295-
WTROUBLE(dc,"XS_UNWATCH with transaction");
295+
WTROUBLE("XS_UNWATCH with transaction");
296296
if (!watch_message_parse(&dc->wbuf.msg, &wpath, &wtoken))
297-
WTROUBLE(dc,"bad XS_WATCH message");
297+
WTROUBLE("bad XS_WATCH message");
298298

299299
watch = find_visible_watch(dc, wpath, wtoken);
300300
if (!watch)
301-
WTROUBLE(dc,"unwatch nonexistent watch");
301+
WTROUBLE("unwatch nonexistent watch");
302302

303303
watch->visible_to_user = 0;
304304
make_watch_request(dc, req, dc->wbuf.msg.tx_id, watch);
305305
break;
306306

307307
default:
308-
WTROUBLE(dc,"unknown request message type");
308+
WTROUBLE("unknown request message type");
309309
}
310310

311311
err = 0;

platform/xen/librumpxen_xendev/busdev_user.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ struct rumpxenbus_data_common {
2020
};
2121

2222
/* void __NORETURN__ WTROUBLE(const char *details_without_newline);
23-
* assumes: int err;
23+
* assumes: struct rumpxenbus_data_common *dc;
24+
* int err;
2425
* end: */
25-
#define WTROUBLE(dc,s) do{ rumpxenbus_write_trouble((dc),s); err = EINVAL; goto end; }while(0)
26+
#define WTROUBLE(s) do{ rumpxenbus_write_trouble((dc),s); err = EINVAL; goto end; }while(0)
2627

2728
void
2829
rumpxenbus_write_trouble(struct rumpxenbus_data_common *dc, const char *what);

0 commit comments

Comments
 (0)