All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 2/3] staging: lustre: include: replace OBD_CHECK_DEV_ACTIVE by obd_check_dev_active
Date: Wed, 1 Apr 2015 16:35:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1504011635160.6929@hadrien> (raw)
In-Reply-To: <c9c6240dc1e51a0ffdcdfe0fc7b392712b7ee4e9.1427894169.git.mahfouz.saif.elyazal@gmail.com>

> +static inline int obd_check_dev_active(struct obd_device *obd)
> +{
> +	int rc;
>
> +	rc = obd_check_dev(obd);
> +	if (rc)
> +		return rc;
> +	if (!(obd)->obd_set_up || (obd)->obd_stopping) {

You can get rid of the parentheses here too.

julia

> +		CERROR("Device %d not setup\n", (obd)->obd_minor);
> +		return -ENODEV;
> +	}
> +	return rc;
> +}
>  #if defined (CONFIG_PROC_FS)
>  #define OBD_COUNTER_OFFSET(op)				  \
>  	((offsetof(struct obd_ops, o_ ## op) -		  \
> @@ -901,7 +913,9 @@ static inline int obd_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
>  	struct obd_device *obd = imp->imp_obd;
>  	int rc;
>
> -	OBD_CHECK_DEV_ACTIVE(obd);
> +	rc = obd_check_dev_active(obd);
> +	if (rc)
> +		return rc;
>  	OBD_CHECK_DT_OP(obd, add_conn, -EOPNOTSUPP);
>  	OBD_COUNTER_INCREMENT(obd, add_conn);
>
> @@ -914,7 +928,9 @@ static inline int obd_del_conn(struct obd_import *imp, struct obd_uuid *uuid)
>  	struct obd_device *obd = imp->imp_obd;
>  	int rc;
>
> -	OBD_CHECK_DEV_ACTIVE(obd);
> +	rc = obd_check_dev_active(obd);
> +	if (rc)
> +		return rc;
>  	OBD_CHECK_DT_OP(obd, del_conn, -EOPNOTSUPP);
>  	OBD_COUNTER_INCREMENT(obd, del_conn);
>
> @@ -948,7 +964,9 @@ static inline int obd_connect(const struct lu_env *env,
>  	__u64 ocf = data ? data->ocd_connect_flags : 0; /* for post-condition
>  						   * check */
>
> -	OBD_CHECK_DEV_ACTIVE(obd);
> +	rc = obd_check_dev_active(obd);
> +	if (rc)
> +		return rc;
>  	OBD_CHECK_DT_OP(obd, connect, -EOPNOTSUPP);
>  	OBD_COUNTER_INCREMENT(obd, connect);
>
> @@ -970,7 +988,9 @@ static inline int obd_reconnect(const struct lu_env *env,
>  	__u64 ocf = d ? d->ocd_connect_flags : 0; /* for post-condition
>  						   * check */
>
> -	OBD_CHECK_DEV_ACTIVE(obd);
> +	rc = obd_check_dev_active(obd);
> +	if (rc)
> +		return rc;
>  	OBD_CHECK_DT_OP(obd, reconnect, 0);
>  	OBD_COUNTER_INCREMENT(obd, reconnect);
>
> --
> 2.1.0
>
>
> --
> Kind Regards,
> Aya Saif El-yazal Mahfouz
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/c9c6240dc1e51a0ffdcdfe0fc7b392712b7ee4e9.1427894169.git.mahfouz.saif.elyazal%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


  reply	other threads:[~2015-04-01 14:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 13:57 [PATCH 0/3] staging: lustre: include: replace macros by functions Aya Mahfouz
2015-04-01 13:58 ` [PATCH 1/3] staging: lustre: include: replace OBD_CHECK_DEV by obd_check_dev Aya Mahfouz
2015-04-01 14:34   ` [Outreachy kernel] " Julia Lawall
2015-04-01 13:59 ` [PATCH 2/3] staging: lustre: include: replace OBD_CHECK_DEV_ACTIVE by obd_check_dev_active Aya Mahfouz
2015-04-01 14:35   ` Julia Lawall [this message]
2015-04-01 15:14     ` [Outreachy kernel] " Aya Mahfouz
2015-04-01 13:59 ` [PATCH 3/3] staging: lustre: include: remove unused macros Aya Mahfouz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1504011635160.6929@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=mahfouz.saif.elyazal@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.