From: Steve French <smfrench@gmail.com>
To: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Cc: Steve French <sfrench@samba.org>,
CIFS <linux-cifs@vger.kernel.org>,
samba-technical <samba-technical@lists.samba.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs: cifs: cifsssmb: Change return type of convert_ace_to_cifs_ace
Date: Tue, 2 Jul 2019 16:29:10 -0500 [thread overview]
Message-ID: <CAH2r5mtrVbTP-iO6XebrXXL83aS80RDiYS7G4-FZC43-ieUk8w@mail.gmail.com> (raw)
In-Reply-To: <20190702182001.GA11497@hari-Inspiron-1545>
merged into cifs-2.6.git for-next
On Tue, Jul 2, 2019 at 1:20 PM Hariprasad Kelam
<hariprasad.kelam@gmail.com> wrote:
>
> Change return from int to void of convert_ace_to_cifs_ace as it never
> fails.
>
> fixes below issue reported by coccicheck
> fs/cifs/cifssmb.c:3606:7-9: Unneeded variable: "rc". Return "0" on line
> 3620
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
> fs/cifs/cifssmb.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 2ea2855..6228719 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -3600,11 +3600,9 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen,
> return size;
> }
>
> -static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
> +static void convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
> const struct posix_acl_xattr_entry *local_ace)
> {
> - __u16 rc = 0; /* 0 = ACL converted ok */
> -
> cifs_ace->cifs_e_perm = le16_to_cpu(local_ace->e_perm);
> cifs_ace->cifs_e_tag = le16_to_cpu(local_ace->e_tag);
> /* BB is there a better way to handle the large uid? */
> @@ -3617,7 +3615,6 @@ static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
> cifs_dbg(FYI, "perm %d tag %d id %d\n",
> ace->e_perm, ace->e_tag, ace->e_id);
> */
> - return rc;
> }
>
> /* Convert ACL from local Linux POSIX xattr to CIFS POSIX ACL wire format */
> @@ -3653,13 +3650,8 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
> cifs_dbg(FYI, "unknown ACL type %d\n", acl_type);
> return 0;
> }
> - for (i = 0; i < count; i++) {
> - rc = convert_ace_to_cifs_ace(&cifs_acl->ace_array[i], &ace[i]);
> - if (rc != 0) {
> - /* ACE not converted */
> - break;
> - }
> - }
> + for (i = 0; i < count; i++)
> + convert_ace_to_cifs_ace(&cifs_acl->ace_array[i], &ace[i]);
> if (rc == 0) {
> rc = (__u16)(count * sizeof(struct cifs_posix_ace));
> rc += sizeof(struct cifs_posix_acl);
> --
> 2.7.4
>
--
Thanks,
Steve
prev parent reply other threads:[~2019-07-03 0:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 18:20 [PATCH] fs: cifs: cifsssmb: Change return type of convert_ace_to_cifs_ace Hariprasad Kelam
2019-07-02 21:29 ` 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=CAH2r5mtrVbTP-iO6XebrXXL83aS80RDiYS7G4-FZC43-ieUk8w@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=hariprasad.kelam@gmail.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samba-technical@lists.samba.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).