Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3632496ybi; Tue, 2 Jul 2019 10:48:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwa/vCb9VaAaWEY9Hpc1cFy8904l09zza6asJWoXqUXyz4Sa8hT6f/pDt+IfEP5WJlhb80Z X-Received: by 2002:a17:902:e707:: with SMTP id co7mr9928635plb.136.1562089707114; Tue, 02 Jul 2019 10:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562089707; cv=none; d=google.com; s=arc-20160816; b=colqu0pBBwAjCZKo7+shYuKoTjSC7KYp72k9pFaDYRG6bQaFLCkNO2K5zstIP5bBdb aMU0wyjxgmCpfH8PXSG1aXVVSdnTK9uDfXPrmvi5sxje0G9icOXBI692c4clEj1hy/l5 ahtO8M8i3jch/Y8lfF8YOszER+BRuynXnlcCK/6IqgX3yTwIxsA4tL2BBcPhOtOH/fYw mwGQVroIX5YwOD2O1qlFANWu5HV5daJzW5/RaGRTvj5qIvvBzqC5v3wxAGbrFicrRxXA dMOMAHiEFni7LXt649YKRNLgXnTD92XlAw8qiKaN1Eq2h0Tl9BV6VhERpIcLpSP/0T8e fwJw== 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=Jzz759w5WsLp9Pj0z8kof2AyohkrQmdR6AqTftOfq00=; b=l68YuF+MANCx5DE73q/vk5TvCzCLBT6nB7LRPTTnr08UGSj20S+YbgMcQsJZ2S84MV pGfnH2MlZMapDf/8DGE/adEDt2uzjwDCOHKp/jMpUsopyQhStQDTRRE85lPoR3TeexdU hlWzZ1z0Yg2TpZMUFU4D7lnt1cCaMI0zJ9ZZivY9mecHOHVBYEKEBLNOw2TOLWfBBcVY JxbQqV3mtxoezEMSZO2y4cWlHutabK/JyxhmaADiVAcgrNet7XS+9m9y0ENlm+Hla43g 3JUU4RpWRLv5j4LGyzNRZWy8Moq+mADutqcybIqcCCTQDNwaY1o9UISCmf2Dq0EPY6Ld 7vGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQ31jsiS; 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 t191si9000679pgd.370.2019.07.02.10.48.12; Tue, 02 Jul 2019 10:48:27 -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=YQ31jsiS; 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 S1727049AbfGBRr3 (ORCPT + 99 others); Tue, 2 Jul 2019 13:47:29 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40323 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfGBRr3 (ORCPT ); Tue, 2 Jul 2019 13:47:29 -0400 Received: by mail-pf1-f194.google.com with SMTP id p184so8614694pfp.7; Tue, 02 Jul 2019 10:47:28 -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=Jzz759w5WsLp9Pj0z8kof2AyohkrQmdR6AqTftOfq00=; b=YQ31jsiSplK9q6mCpGc6wFd64eZZ+z83KgJaX9GpWwnud5QdIq6cqI1rRa9vrKG6ek Ry8kcx6GtktkY8TvZwvd95PuQsq/wVS2PdeLUfAe8CfNhxDrCp94snQALcJ+Oc2e7ITx OyhfK9Feg7T62HYLWKmmNkx5u8l3eLaN/ASexTTGYx9DtTciFfZVL0QO7BlE4LTc535c AF3ytE6ZByz61/fsKdcNvLyZwjdYBlYMZW+aFQTmaiQ4GeP9x1QNK7DUQTQ9wtll0HUN vIBaenuQbOAwM63CpfH3UPe+p9T+DUEwq5qdqbmpaXHnA+Y0gdvybzxcMwF4fwA5htVt G6mA== 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=Jzz759w5WsLp9Pj0z8kof2AyohkrQmdR6AqTftOfq00=; b=j0o/zy6WelaI5ru+mfwZ9kZKtGwGnzBzSix0XbYQwcj/4Q/1tYND/HP/yKfsOMrFtR K5BuhWN5maFY2zD3O3wyDk5GjV9Z9oHgvvKirRv6e1Qa2dh/hYrNAxeQrtDtfA0GnLH2 3ucqS0vutY2cefQP9tC/WeBVsATYoKSU9jFFp9IUIgdArZGv/ef8OXuILTFV2ynN58QK /61at+WFegDOkOkyUZLZn82VkNlPlHMe8HrtmpLTJigQUIeIY/5/uPE1W960HC9AXD5v xIWuFCchU3Few8Hac4whE5EQtWvQSGT8tmDoDAAK+K+PMBRHjftW/hskgYcz7ER7V+JC AqiQ== X-Gm-Message-State: APjAAAWdFJKky+JvsuL/3bcq8+gPFIc2mQz6/OUmx3p8+fMgxpu4V15v 2ELF07dsNNfJZiekpTC2WQz19bYR X-Received: by 2002:a17:90a:d997:: with SMTP id d23mr6638752pjv.84.1562089648449; Tue, 02 Jul 2019 10:47:28 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.187]) by smtp.gmail.com with ESMTPSA id i3sm15303855pfo.138.2019.07.02.10.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2019 10:47:27 -0700 (PDT) Date: Tue, 2 Jul 2019 23:17:24 +0530 From: Hariprasad Kelam To: Tyler Hicks , ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs: ecryptfs: crypto: Change return type of ecryptfs_process_flags Message-ID: <20190702174723.GA4600@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 type of ecryptfs_process_flags from int to void. As it never fails. fixes below issue reported by coccicheck s/ecryptfs/crypto.c:870:5-7: Unneeded variable: "rc". Return "0" on line 883 Signed-off-by: Hariprasad Kelam --- fs/ecryptfs/crypto.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 509a767..55a633e 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -864,10 +864,9 @@ static struct ecryptfs_flag_map_elem ecryptfs_flag_map[] = { * * Returns zero on success; non-zero if the flag set is invalid */ -static int ecryptfs_process_flags(struct ecryptfs_crypt_stat *crypt_stat, +static void ecryptfs_process_flags(struct ecryptfs_crypt_stat *crypt_stat, char *page_virt, int *bytes_read) { - int rc = 0; int i; u32 flags; @@ -880,7 +879,6 @@ static int ecryptfs_process_flags(struct ecryptfs_crypt_stat *crypt_stat, /* Version is in top 8 bits of the 32-bit flag vector */ crypt_stat->file_version = ((flags >> 24) & 0xFF); (*bytes_read) = 4; - return rc; } /** @@ -1306,12 +1304,9 @@ static int ecryptfs_read_headers_virt(char *page_virt, if (!(crypt_stat->flags & ECRYPTFS_I_SIZE_INITIALIZED)) ecryptfs_i_size_init(page_virt, d_inode(ecryptfs_dentry)); offset += MAGIC_ECRYPTFS_MARKER_SIZE_BYTES; - rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset), + ecryptfs_process_flags(crypt_stat, (page_virt + offset), &bytes_read); - if (rc) { - ecryptfs_printk(KERN_WARNING, "Error processing flags\n"); - goto out; - } + if (crypt_stat->file_version > ECRYPTFS_SUPPORTED_FILE_VERSION) { ecryptfs_printk(KERN_WARNING, "File version is [%d]; only " "file version [%d] is supported by this " -- 2.7.4