Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -122,8 +122,10 @@ static void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data,

#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 *