All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return
Date: Sun, 1 Mar 2015 16:45:09 -0800	[thread overview]
Message-ID: <20150302004509.GA7519@kroah.com> (raw)
In-Reply-To: <1425151385-31082-1-git-send-email-hamohammed.sa@gmail.com>

On Sat, Feb 28, 2015 at 10:23:05PM +0300, Haneen Mohammed wrote:
> This patch fix else is not usefull after break or return.
> Issue addressed by checkpatch.pl
> 
> Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ldlm/ldlm_lib.c   |  4 ++--
>  drivers/staging/lustre/lustre/ldlm/ldlm_lock.c  | 10 +++++-----
>  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 17 ++++++++---------
>  drivers/staging/lustre/lustre/ldlm/ldlm_pool.c  |  3 +--
>  4 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
> index c5c86e7..7bcae30 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
> @@ -668,10 +668,10 @@ int target_send_reply_msg(struct ptlrpc_request *req, int rc, int fail_id)
>  		DEBUG_REQ(D_NET, req, "processing error (%d)", rc);
>  		req->rq_status = rc;
>  		return ptlrpc_send_error(req, 1);
> -	} else {
> -		DEBUG_REQ(D_NET, req, "sending reply");
>  	}
>  
> +	DEBUG_REQ(D_NET, req, "sending reply");
> +
>  	return ptlrpc_send_reply(req, PTLRPC_REPLY_MAYBE_DIFFICULT);
>  }
>  
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> index bd8d458..28f2639 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> @@ -932,7 +932,8 @@ static void search_granted_lock(struct list_head *queue,
>  			prev->mode_link = &mode_end->l_sl_mode;
>  			prev->policy_link = &req->l_sl_policy;
>  			return;
> -		} else if (lock->l_resource->lr_type == LDLM_IBITS) {
> +		}
> +		if (lock->l_resource->lr_type == LDLM_IBITS) {
>  			for (;;) {
>  				policy_end =
>  					list_entry(lock->l_sl_policy.prev,
> @@ -968,11 +969,10 @@ static void search_granted_lock(struct list_head *queue,
>  			prev->mode_link = &mode_end->l_sl_mode;
>  			prev->policy_link = &req->l_sl_policy;
>  			return;
> -		} else {
> -			LDLM_ERROR(lock,
> -				   "is not LDLM_PLAIN or LDLM_IBITS lock");
> -			LBUG();
>  		}
> +		LDLM_ERROR(lock,
> +				"is not LDLM_PLAIN or LDLM_IBITS lock");
> +		LBUG();
>  	}
>  
>  	/* insert point is last lock on the queue,
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> index cd15445..4abca14 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> @@ -456,16 +456,15 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
>  		init_blwi(blwi, ns, ld, cancels, count, lock, cancel_flags);
>  
>  		return __ldlm_bl_to_thread(blwi, cancel_flags);
> -	} else {
> -		/* if it is synchronous call do minimum mem alloc, as it could
> -		 * be triggered from kernel shrinker
> -		 */
> -		struct ldlm_bl_work_item blwi;
> -
> -		memset(&blwi, 0, sizeof(blwi));
> -		init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags);
> -		return __ldlm_bl_to_thread(&blwi, cancel_flags);
>  	}
> +	/* if it is synchronous call do minimum mem alloc, as it could
> +	* be triggered from kernel shrinker
> +	*/

Formatting of this comment block changed :(



  reply	other threads:[~2015-03-02  0:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
2015-02-28 19:17 ` [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters Haneen Mohammed
2015-02-28 20:01   ` [Outreachy kernel] " Julia Lawall
2015-02-28 21:58     ` Haneen Mohammed
2015-02-28 19:20 ` [PATCH 2/5] Staging: lustre: lustre: idlm: Move trailing statement to next line Haneen Mohammed
2015-02-28 19:21 ` [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c Haneen Mohammed
2015-03-02  0:43   ` [Outreachy kernel] " Greg KH
2015-02-28 19:23 ` [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return Haneen Mohammed
2015-03-02  0:45   ` Greg KH [this message]
2015-02-28 19:33 ` [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string Haneen Mohammed
2015-02-28 19:56   ` [Outreachy kernel] " Julia Lawall
2015-02-28 20:01     ` Haneen Mohammed
2015-02-28 20:03       ` Julia Lawall

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=20150302004509.GA7519@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=hamohammed.sa@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.