mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: Yang Li <yang.lee@linux.alibaba.com>
Cc: agruenba@redhat.com, cluster-devel@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gfs2: Remove unneeded return variable
Date: Wed, 3 Mar 2021 10:40:20 -0500 (EST)	[thread overview]
Message-ID: <270744488.59307524.1614786020378.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1614676526-102967-1-git-send-email-yang.lee@linux.alibaba.com>

----- Original Message -----
> This patch removes unneeded return variables, using only
> '0' instead.
> It fixes the following warning detected by coccinelle:
> ./fs/gfs2/super.c:592:5-10: Unneeded variable: "error". Return "0" on
> line 628
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  fs/gfs2/super.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 861ed5f..fe2dae4 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -589,7 +589,6 @@ static void gfs2_dirty_inode(struct inode *inode, int
> flags)
>  
>  int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
>  {
> -	int error = 0;
>  	int log_write_allowed = test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
>  
>  	gfs2_flush_delete_work(sdp);
> @@ -625,7 +624,7 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
>  	if (!log_write_allowed)
>  		sdp->sd_vfs->s_flags |= SB_RDONLY;
>  
> -	return error;
> +	return 0;
>  }
>  
>  /**
> --
> 1.8.3.1

Hi Yang,

Thanks for submitting your patch. I like it. However, since gfs2_make_fs_ro
always returns 0, we should also be able to make it a void function instead
of int, and change its callers to not act on any return code.

Regards,

Bob Peterson
Red Hat File Systems


      reply	other threads:[~2021-03-03 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  9:15 Yang Li
2021-03-03 15:40 ` Bob Peterson [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=270744488.59307524.1614786020378.JavaMail.zimbra@redhat.com \
    --to=rpeterso@redhat.com \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.lee@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®