linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Qiujun Huang <hqjagain@gmail.com>
Cc: Steve French <sfrench@samba.org>,
	CIFS <linux-cifs@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs/cifs: fix gcc warning in sid_to_id
Date: Wed, 4 Mar 2020 11:16:25 -0600	[thread overview]
Message-ID: <CAH2r5mshu2YmrUFcO2Swb2512fRV0V7wU=y27TJr2PEQBU5puw@mail.gmail.com> (raw)
In-Reply-To: <1583307771-16365-1-git-send-email-hqjagain@gmail.com>

merged into cifs-2.6.git for-next

On Wed, Mar 4, 2020 at 1:42 AM Qiujun Huang <hqjagain@gmail.com> wrote:
>
> fix warning [-Wunused-but-set-variable] at variable 'rc',
> keeping the code readable.
>
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
>  fs/cifs/cifsacl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index 716574a..ae42163 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -342,7 +342,7 @@
>  sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
>                 struct cifs_fattr *fattr, uint sidtype)
>  {
> -       int rc;
> +       int rc = 0;
>         struct key *sidkey;
>         char *sidstr;
>         const struct cred *saved_cred;
> @@ -450,11 +450,12 @@
>          * fails then we just fall back to using the mnt_uid/mnt_gid.
>          */
>  got_valid_id:
> +       rc = 0;
>         if (sidtype == SIDOWNER)
>                 fattr->cf_uid = fuid;
>         else
>                 fattr->cf_gid = fgid;
> -       return 0;
> +       return rc;
>  }
>
>  int
> --
> 1.8.3.1
>


-- 
Thanks,

Steve

      reply	other threads:[~2020-03-04 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  7:42 [PATCH] fs/cifs: fix gcc warning in sid_to_id Qiujun Huang
2020-03-04 17:16 ` Steve French [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='CAH2r5mshu2YmrUFcO2Swb2512fRV0V7wU=y27TJr2PEQBU5puw@mail.gmail.com' \
    --to=smfrench@gmail.com \
    --cc=hqjagain@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@samba.org \
    /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;
as well as URLs for NNTP newsgroup(s).