All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: akpm@linux-foundation.org, ocfs2-devel@oss.oracle.com
Cc: CGEL ZTE <cgel.zte@gmail.com>, Minghao Chi <chi.minghao@zte.com.cn>
Subject: Re: [Ocfs2-devel] [PATCH] ocfs2: cleanup some return variables
Date: Fri, 21 Jan 2022 09:46:35 +0800	[thread overview]
Message-ID: <9e3793fa-76a9-8190-a090-5655c49a7352@linux.alibaba.com> (raw)
In-Reply-To: <20220114021641.13927-1-joseph.qi@linux.alibaba.com>

Hi Andrew,
Could you please consider add this to -mm tree?

Thanks,
Joseph

On 1/14/22 10:16 AM, Joseph Qi wrote:
> Simply return directly instead of assign the return value to another
> variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Cc: Minghao Chi <chi.minghao@zte.com.cn>
> Cc: CGEL ZTE <cgel.zte@gmail.com>
> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/file.c       |  9 +++------
>  fs/ocfs2/stack_user.c | 18 ++++++------------
>  2 files changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
> index fc5f780fa235..24321c44cd42 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -540,15 +540,12 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb,
>  			 struct ocfs2_alloc_context *meta_ac,
>  			 enum ocfs2_alloc_restarted *reason_ret)
>  {
> -	int ret;
>  	struct ocfs2_extent_tree et;
>  
>  	ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), fe_bh);
> -	ret = ocfs2_add_clusters_in_btree(handle, &et, logical_offset,
> -					  clusters_to_add, mark_unwritten,
> -					  data_ac, meta_ac, reason_ret);
> -
> -	return ret;
> +	return ocfs2_add_clusters_in_btree(handle, &et, logical_offset,
> +					   clusters_to_add, mark_unwritten,
> +					   data_ac, meta_ac, reason_ret);
>  }
>  
>  static int ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
> diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
> index 85a47621e0c0..a75e2b7d67f5 100644
> --- a/fs/ocfs2/stack_user.c
> +++ b/fs/ocfs2/stack_user.c
> @@ -683,28 +683,22 @@ static int user_dlm_lock(struct ocfs2_cluster_connection *conn,
>  			 void *name,
>  			 unsigned int namelen)
>  {
> -	int ret;
> -
>  	if (!lksb->lksb_fsdlm.sb_lvbptr)
>  		lksb->lksb_fsdlm.sb_lvbptr = (char *)lksb +
>  					     sizeof(struct dlm_lksb);
>  
> -	ret = dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm,
> -		       flags|DLM_LKF_NODLCKWT, name, namelen, 0,
> -		       fsdlm_lock_ast_wrapper, lksb,
> -		       fsdlm_blocking_ast_wrapper);
> -	return ret;
> +	return dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm,
> +			flags|DLM_LKF_NODLCKWT, name, namelen, 0,
> +			fsdlm_lock_ast_wrapper, lksb,
> +			fsdlm_blocking_ast_wrapper);
>  }
>  
>  static int user_dlm_unlock(struct ocfs2_cluster_connection *conn,
>  			   struct ocfs2_dlm_lksb *lksb,
>  			   u32 flags)
>  {
> -	int ret;
> -
> -	ret = dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid,
> -			 flags, &lksb->lksb_fsdlm, lksb);
> -	return ret;
> +	return dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid,
> +			  flags, &lksb->lksb_fsdlm, lksb);
>  }
>  
>  static int user_dlm_lock_status(struct ocfs2_dlm_lksb *lksb)

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

      reply	other threads:[~2022-01-21  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  2:16 [Ocfs2-devel] [PATCH] ocfs2: cleanup some return variables Joseph Qi via Ocfs2-devel
2022-01-21  1:46 ` Joseph Qi via Ocfs2-devel [this message]

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=9e3793fa-76a9-8190-a090-5655c49a7352@linux.alibaba.com \
    --to=ocfs2-devel@oss.oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=joseph.qi@linux.alibaba.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.