Commit 8a703a38 authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Ilya Dryomov

libceph: evaluate osd_req_op_data() arguments only once

This patch changes the osd_req_op_data() macro to not evaluate
arguments more than once in order to follow the kernel coding style.
Signed-off-by: default avatarIoana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
[idryomov@gmail.com: changelog, formatting]
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 68cd5b4b
......@@ -121,10 +121,12 @@ static void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data,
#endif /* CONFIG_BLOCK */
#define osd_req_op_data(oreq, whch, typ, fld) \
({ \
BUG_ON(whch >= (oreq)->r_num_ops); \
&(oreq)->r_ops[whch].typ.fld; \
})
({ \
struct ceph_osd_request *__oreq = (oreq); \
unsigned int __whch = (whch); \
BUG_ON(__whch >= __oreq->r_num_ops); \
&__oreq->r_ops[__whch].typ.fld; \
})
static struct ceph_osd_data *
osd_req_op_raw_data_in(struct ceph_osd_request *osd_req, unsigned int which)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment