diff mbox

net: ceph: osd_client: change osd_req_op_data() macro

Message ID 1445526367-8258-1-git-send-email-ciorneiioana@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ioana Ciornei Oct. 22, 2015, 3:06 p.m. UTC
This patch changes the osd_req_op_data() macro to not evaluate
parameters more than once in order to follow the kernel coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
---
 net/ceph/osd_client.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Ilya Dryomov Oct. 29, 2015, 2:34 p.m. UTC | #1
On Thu, Oct 22, 2015 at 5:06 PM, Ioana Ciornei <ciorneiioana@gmail.com> wrote:
> This patch changes the osd_req_op_data() macro to not evaluate
> parameters more than once in order to follow the kernel coding style.
>
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> Reviewed-by: Alex Elder <elder@linaro.org>
> ---
>  net/ceph/osd_client.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index a362d7e..856e8f8 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -120,10 +120,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;           \
> +#define osd_req_op_data(oreq, 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 *

For some reason this ended up in Spam - you should CC subsystem
maintainer(s) on any patch, as noted in Documentation/SubmittingPatches.

Applied with minor changes, see
https://github.com/ceph/ceph-client/commit/51dcb83f3d1143819fe0791c112e1b1f830e457d.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index a362d7e..856e8f8 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -120,10 +120,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;		\
+#define osd_req_op_data(oreq, 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 *