Linux-CIFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] fs/cifs: fix gcc warning in sid_to_id
@ 2020-03-04  7:42 Qiujun Huang
  2020-03-04 17:16 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Qiujun Huang @ 2020-03-04  7:42 UTC (permalink / raw)
  To: sfrench; +Cc: linux-cifs, linux-kernel, smfrench, Qiujun Huang

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/cifs: fix gcc warning in sid_to_id
  2020-03-04  7:42 [PATCH] fs/cifs: fix gcc warning in sid_to_id Qiujun Huang
@ 2020-03-04 17:16 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2020-03-04 17:16 UTC (permalink / raw)
  To: Qiujun Huang; +Cc: Steve French, CIFS, LKML

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  7:42 [PATCH] fs/cifs: fix gcc warning in sid_to_id Qiujun Huang
2020-03-04 17:16 ` Steve French

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git