Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3727851ybi; Tue, 2 Jul 2019 12:26:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/CgpU5cnCV+1Y2uL/k9vZlwCctLq3iYAYYQ3jl85JXkgsx3S+KeAkgyyO/lL36rm9lj/7 X-Received: by 2002:a17:902:b215:: with SMTP id t21mr37812740plr.123.1562095593651; Tue, 02 Jul 2019 12:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562095593; cv=none; d=google.com; s=arc-20160816; b=TRawEpKFglg9/sr8I3j147hOgnU5v/wB4AdFloVMpfDXkZiAPmsTP26gmxO73qnLNZ XeAFtLhDia4us9UjIL/MfpbNrI/Fi0GSrw5HZJUJrf6CSs2PH1DWvWQeUO5wI3BO7Hev 4qfvozLaZQs4W18NVgKHXd3kztoCA58z1xqqNNf662QtgpM48mJ96L+SwFBh/nXPkBfe iSD7UrjyyoUFezzd1a2iUuMBltnMwaKKeZZmZjQukV6rvCOBNsZxH8cR+JoWzfnm3VhD 6OnA9vcUuGOgbeKFEdd3YcTrmBextIr2k2M3PZlzlXBimaJ4Q9j1W7RNTxTEg7HEV9eR VYZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EoAsY39PKWHXd5zZmZaTlyIBFG9IhmTv8GWE9gTHIWQ=; b=fSO8Xi3DeQBNycAYOrP8xOgyX+XflrgdwxYUHkH44U2OUApNpuEkP6tTbnmoBDNW6V Vp+P+vxuvfS3wzWBTk7qpb3uYr+NXL2WQMpoAmgdSjInRohodw7iAOsNwodGMKIpIoJ1 pp1OKCyQDCNMUA6IzrsZjLjcwq7U3M7kC7VC0BsUiSYeFJJDsMqtXJNH9WpEgTeLYu67 fttI3RH0C7mDuKL2Pz/eC2beYOAsr9QG+CSq+pGbI27XcvSd9JDIIYi3xZUhTewVy23k OFh1Hnggsr15ROBhoVfK9rysyLVkexpt2pHLeNY9U6HGljDS7srPVGlB09d6Tj5tM2Lx xurQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si13236296pgm.431.2019.07.02.12.26.18; Tue, 02 Jul 2019 12:26:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727089AbfGBTZ5 (ORCPT + 99 others); Tue, 2 Jul 2019 15:25:57 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60394 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfGBTZ5 (ORCPT ); Tue, 2 Jul 2019 15:25:57 -0400 Received: from 162-237-133-238.lightspeed.rcsntx.sbcglobal.net ([162.237.133.238] helo=elm) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hiOPa-000302-Sf; Tue, 02 Jul 2019 19:25:55 +0000 Date: Tue, 2 Jul 2019 14:25:51 -0500 From: Tyler Hicks To: Hariprasad Kelam Cc: ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: ecryptfs: crypto: Change return type of ecryptfs_process_flags Message-ID: <20190702192551.GB8314@elm> References: <20190702174723.GA4600@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702174723.GA4600@hari-Inspiron-1545> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-07-02 23:17:24, Hariprasad Kelam wrote: > 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 > --- Thanks for the cleanup! I made some minor tweaks, as noted below, and pushed it to the eCryptfs next branch. > 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 I deleted this line from the function documentation. > */ > -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); The line was short enough to move the last argument up to the same line so I went ahead and did that. Thanks again! Tyler > - 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 >