From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FA18192B82; Thu, 20 Mar 2025 02:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742437564; cv=none; b=pVc0xX1LMEBecajsJh0k25IbODWdEoXuzzgQrCj/QO9N7MfXUH7OkMOgK2gKlBRHB72N5UDwPHPvVoa5AkA9Kr8S0y5mKcTdevweT4M9g4HnU4ejnKGAMQ6X5mYEgk8JjFLriRw1Gtf9dJLkGQvs7cj01yzmKcGEgRx8uG1AVlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742437564; c=relaxed/simple; bh=wd4bDV3Pbt8B3W9w906X2pNdOFxkfrKKq9cy9tqyocI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DMKzy1VPdH0XBaAXO/why94aioOMipU3yJN0p6d5hFqoY+F7npT+SU2EJfbKCuUu5CfarQ6yFoFshbxGrxeJAL8duU6nAkqZYwyxGpvOFS5MrfExflNK59OEcthTG6u6qF2Q5+4YN8O0rLvzykEjDUMTQqcdG7NJl2syX1pn9wI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NW0iqYGr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NW0iqYGr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E863C4CEE4; Thu, 20 Mar 2025 02:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742437563; bh=wd4bDV3Pbt8B3W9w906X2pNdOFxkfrKKq9cy9tqyocI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NW0iqYGr9u018xkh9A+wagJOm0WjRvlK8XZjDMnPzm7eFCXN/lkzjOH3lxtTQQCPR KPluGt7UgPwguLuAJmccnFOjURi4XuYP8Au49RM8AdV99eePCDj15xIPRK1OmeAbaK 4KYVoFL45mkH/znPMB+2kJg9ww8qMcHS6uZ0lp1hwIn7Xi4p5AW6tVvRFKdIe900h9 sBUNUOCF+G4kKP5lBe7QHINoArAa1yYiSxqJrDhE8/3VNdyzkRhfU1NVTggOIjKN8T AUZ5ZwJ+s0mt6U7OaMIz4n6uEE8Hgimv4moGsFN332LTOhn7+UBHBHx+htarvt+gC2 dq0jr92Ej7xEg== Date: Thu, 20 Mar 2025 02:26:01 +0000 From: Jaegeuk Kim To: Dan Carpenter Cc: Colin Ian King , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] f2fs: remove redundant assignment to variable err Message-ID: References: <20250319113011.791319-1-colin.i.king@gmail.com> Precedence: bulk X-Mailing-List: kernel-janitors@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 03/19, Dan Carpenter wrote: > On Wed, Mar 19, 2025 at 11:30:10AM +0000, Colin Ian King wrote: > > The variable err is being assigned a value zero and then the following > > goto page_hit reassigns err a new value. The zero assignment is redundant > > and can be removed. > > > > Signed-off-by: Colin Ian King > > --- > > fs/f2fs/node.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > index 5f15c224bf78..37c76bb19a8c 100644 > > --- a/fs/f2fs/node.c > > +++ b/fs/f2fs/node.c > > @@ -1497,7 +1497,6 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid, > > if (err < 0) { > > goto out_put_err; > > } else if (err == LOCKED_PAGE) { > > - err = 0; > > goto page_hit; > > } > > We could remove the curly braces as well. Applied as below. Thanks. @@ -1494,12 +1494,10 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid, return folio; err = read_node_page(&folio->page, 0); - if (err < 0) { + if (err < 0) goto out_put_err; - } else if (err == LOCKED_PAGE) { - err = 0; + if (err == LOCKED_PAGE) goto page_hit; - } if (parent) f2fs_ra_node_pages(parent, start + 1, MAX_RA_NODE); > > regards, > dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26E84C35FFC for ; Thu, 20 Mar 2025 02:26:23 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tv5bw-00066V-IL; Thu, 20 Mar 2025 02:26:21 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tv5bv-00066G-7x for linux-f2fs-devel@lists.sourceforge.net; Thu, 20 Mar 2025 02:26:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6ZNLtBoUWdOYFc3fW9n5uOzf9HxZCTS5hUN5OlK7nn8=; b=Npax8Pm+yUPJoP9QBwOyTGjdZV K8ziTUpz9TkEeWnSdaOnmJii76qfiCw07VCELGxOSjYrqEhjQJA5vXrokU4ofbYT5weYM1D/NTLYn uRoA7Hoh7TUTczs1EyvqbV8TjICdRPSfaI8c780aKD1MORBZKeAS5lQg3Cmj2Vd4G140=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6ZNLtBoUWdOYFc3fW9n5uOzf9HxZCTS5hUN5OlK7nn8=; b=l0K9FP5Tk+d9Z+ETXdF+zoe7Kj +ackjuQfqdGAtbyikY2ezDqf4rmSy0wNHHGnIYMOK7DToBtrZ7aE+lH4Ugla8M6BY5YGs0G05ovY6 hOHiYTNnrsaSNATzpfXfPcfmC9q5YXiv9ZTc9rTa7iDe56gIWRu/JKKTcrGPvzNeA0Ak=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tv5bq-0007mZ-D2 for linux-f2fs-devel@lists.sourceforge.net; Thu, 20 Mar 2025 02:26:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 106E15C6698; Thu, 20 Mar 2025 02:23:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E863C4CEE4; Thu, 20 Mar 2025 02:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742437563; bh=wd4bDV3Pbt8B3W9w906X2pNdOFxkfrKKq9cy9tqyocI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NW0iqYGr9u018xkh9A+wagJOm0WjRvlK8XZjDMnPzm7eFCXN/lkzjOH3lxtTQQCPR KPluGt7UgPwguLuAJmccnFOjURi4XuYP8Au49RM8AdV99eePCDj15xIPRK1OmeAbaK 4KYVoFL45mkH/znPMB+2kJg9ww8qMcHS6uZ0lp1hwIn7Xi4p5AW6tVvRFKdIe900h9 sBUNUOCF+G4kKP5lBe7QHINoArAa1yYiSxqJrDhE8/3VNdyzkRhfU1NVTggOIjKN8T AUZ5ZwJ+s0mt6U7OaMIz4n6uEE8Hgimv4moGsFN332LTOhn7+UBHBHx+htarvt+gC2 dq0jr92Ej7xEg== Date: Thu, 20 Mar 2025 02:26:01 +0000 To: Dan Carpenter Message-ID: References: <20250319113011.791319-1-colin.i.king@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1tv5bq-0007mZ-D2 Subject: Re: [f2fs-dev] [PATCH][next] f2fs: remove redundant assignment to variable err X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jaegeuk Kim via Linux-f2fs-devel Reply-To: Jaegeuk Kim Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Colin Ian King , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 03/19, Dan Carpenter wrote: > On Wed, Mar 19, 2025 at 11:30:10AM +0000, Colin Ian King wrote: > > The variable err is being assigned a value zero and then the following > > goto page_hit reassigns err a new value. The zero assignment is redundant > > and can be removed. > > > > Signed-off-by: Colin Ian King > > --- > > fs/f2fs/node.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > index 5f15c224bf78..37c76bb19a8c 100644 > > --- a/fs/f2fs/node.c > > +++ b/fs/f2fs/node.c > > @@ -1497,7 +1497,6 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid, > > if (err < 0) { > > goto out_put_err; > > } else if (err == LOCKED_PAGE) { > > - err = 0; > > goto page_hit; > > } > > We could remove the curly braces as well. Applied as below. Thanks. @@ -1494,12 +1494,10 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid, return folio; err = read_node_page(&folio->page, 0); - if (err < 0) { + if (err < 0) goto out_put_err; - } else if (err == LOCKED_PAGE) { - err = 0; + if (err == LOCKED_PAGE) goto page_hit; - } if (parent) f2fs_ra_node_pages(parent, start + 1, MAX_RA_NODE); > > regards, > dan carpenter _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel