Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3665540ybi; Tue, 2 Jul 2019 11:20:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQiPMEU0d4m4X2g6H7XZLS/kSGS9xDkYbYxLAGghWRzHPVQIcCSMrT4YhiiE7UTqI8v7X8 X-Received: by 2002:a17:902:8ec3:: with SMTP id x3mr36236526plo.313.1562091649471; Tue, 02 Jul 2019 11:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562091649; cv=none; d=google.com; s=arc-20160816; b=NnFMzsVJXVgIpWzA6VPZrtfXo5nQRTMxuJY6hLJwM30beoNT20Ubj2ZQddxiVzBXKV 31SuAjRWHHInr1lz8R3fX2l/Im1xBW7e3etQqkAKP7IeKo6/gXCM7a7FjyF6BdUThaZo 4w1eIwyYBTQxaS3vBSLLXlZTpPu+qzzPWOcEgPkWz0zrw2ngWP2unRQjJOcTV18G51UZ bitJ0dgAMjdrI7SlR1VDXw7c0SyuKONTzC5RVYbpu6yhytTTJVzlYl3eedeuWt9wfLJF S4eKJfI1g+n8LFHipEK1OK9T9DxzbAFiVmK88kre3QKjdvlq9f6hNuQgUFZg0Jz6n8mg j1LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=Jd8xYP3fG+KhX6g7bNBS4eWXzd05+Eza9a78A930Hq0=; b=paG7vPdwPIUKM/dLpT5hYpp6QeZcFMGBdeD+UDcx1Hk8VdWTzh/fFbg1aIGlyeLtQl zfLlGhdPjAarcRr+VCBXhbvrJXahDiBJk+xFLuaU9WzWnqKUIDY5cExGT5eDTrbI5LCu uIEqU1krG5233emAA50g3/cQEqe3F1ljo5JJAT7dNKtT4kIbVzHT19pNrLa8s3d1OC7j GFRhKL9mYzb8orfv246tczdn8J3Ictr60/e3tckismssQ2VbT0EjZXK5/4k1XyTHns4M 3X7RXGSGBUueyqfq2GiEURV7YAYCt7787LHT4mXdwuhulOEfKMIsdHDticMeDHsLkU8Q IhYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="bgi/EVQT"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s22si14153939pga.189.2019.07.02.11.20.34; Tue, 02 Jul 2019 11:20:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="bgi/EVQT"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbfGBSUH (ORCPT + 99 others); Tue, 2 Jul 2019 14:20:07 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:39738 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfGBSUH (ORCPT ); Tue, 2 Jul 2019 14:20:07 -0400 Received: by mail-pl1-f193.google.com with SMTP id b7so807398pls.6; Tue, 02 Jul 2019 11:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=Jd8xYP3fG+KhX6g7bNBS4eWXzd05+Eza9a78A930Hq0=; b=bgi/EVQTd5450nG5gU42dXnAW6I5Rm4Q8TjxB2Q1cSqxTP0yO9bMY9881nuWVJ7uwb 9/SYbUpu0/QsxTr+WJwrRT6Wt1GIUvByj4L5r1KZY0UOHZxC4YGC9y/lwyzBWS8JnUzh E97mb7q+4HvYFE/1H19B6gKv/rL7zX38ywAeKAh/gKOGUu0+wzCuK02YZJIKy/Wr7NFk 1/2iamcT7Bc7PG6y2Adshl6g/jbf0Vw0ydVvXQ84CryAoD8wrXmplTlYuIQ4W9mmT1AG ns4OGeT7dxIGq5dupRd+IqcvmlMG1qUbaBKsOx7OgB8CfxVMzkEj3uLzledgHqaeYPX3 J0Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=Jd8xYP3fG+KhX6g7bNBS4eWXzd05+Eza9a78A930Hq0=; b=FrB064wA8U28UJVe2plNfpW+7aejogXMIYD0vGes7q0q6XbklnjSQG3KQnbGP3+n4T LsggWAxUoFez6/SrjaqtvbvZR8FZ3qII83nMJE+tnEw4xToDPCDK6gDE1H1V7jKXsrJL AwrwHB9gmGk6iNlFXRmx8wQzrYHalR+Vheb1Rz2B7ojfyrwvP44QMY+ZulQzgkSbxkdP EyDGNzUWD9NLsEpFSePe/2XSWtC1L6yhKElsbdHNedwL+6DWXCawx5nZu4PiSA0smuQw 83gSd1NedxyVlhcd8HPb9kbbbIsAO5Tf0IkuhAEsomN4lf+L7C0bZW9z73/skhlszJAn vMqg== X-Gm-Message-State: APjAAAXYZLf8wYIEhJEwMhxTEkSgK3Pa8WiE50DxJcYF4PRVgWvhsLxs cbnYuM5sCSu/RDMbU1ahSIipZ9K2 X-Received: by 2002:a17:902:b20c:: with SMTP id t12mr37175998plr.285.1562091606504; Tue, 02 Jul 2019 11:20:06 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.187]) by smtp.gmail.com with ESMTPSA id t96sm2881313pjb.1.2019.07.02.11.20.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2019 11:20:05 -0700 (PDT) Date: Tue, 2 Jul 2019 23:50:02 +0530 From: Hariprasad Kelam To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs: cifs: cifsssmb: Change return type of convert_ace_to_cifs_ace Message-ID: <20190702182001.GA11497@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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