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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E472C433F5 for ; Fri, 14 Jan 2022 22:03:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3DC06B00A7; Fri, 14 Jan 2022 17:03:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BC4416B00A9; Fri, 14 Jan 2022 17:03:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A66266B00AA; Fri, 14 Jan 2022 17:03:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id 8BC7A6B00A7 for ; Fri, 14 Jan 2022 17:03:56 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4D1F180EC672 for ; Fri, 14 Jan 2022 22:03:56 +0000 (UTC) X-FDA: 79030270872.12.B5D113C Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf03.hostedemail.com (Postfix) with ESMTP id CB77F20006 for ; Fri, 14 Jan 2022 22:03:54 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CFBA0B82A26; Fri, 14 Jan 2022 22:03:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40722C36AE9; Fri, 14 Jan 2022 22:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642197832; bh=e20GBA0OwqvknUZTAmxB+UM/XpDlxjDw0NO9T5731pM=; h=Date:From:To:Subject:In-Reply-To:From; b=mi1wdk46vNVKyErSwrYPp4la6SedFc9EZQuqtwIjr9upUrWuCbs+ADNxVTr6O1bAD ns/vPQG+cwO4qoh7JrJsq+psq15b+LXJuh/truIMQgaBlfUdfM6uMS+ycZoxOi7BqH ugDcImjLwGNjnsVmZTGPq+B5/iPHvv/QOwkcSCss= Date: Fri, 14 Jan 2022 14:03:51 -0800 From: Andrew Morton To: akpm@linux-foundation.org, colin.i.king@gmail.com, gechangwei@live.cn, ghe@suse.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, junxiao.bi@oracle.com, linux-mm@kvack.org, mark@fasheh.com, mm-commits@vger.kernel.org, piaojun@huawei.com, torvalds@linux-foundation.org Subject: [patch 019/146] ocfs2: remove redundant assignment to variable free_space Message-ID: <20220114220351.qb2sDMT4e%akpm@linux-foundation.org> In-Reply-To: <20220114140222.6b14f0061194d3200000c52d@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: CB77F20006 X-Stat-Signature: 8g1sj8quttbowcdncmna9n4gkyoz4e4p Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=mi1wdk46; dmarc=none; spf=pass (imf03.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam02 X-HE-Tag: 1642197834-803517 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Colin Ian King Subject: ocfs2: remove redundant assignment to variable free_space Variable free_space is being initialized with a value that is not read, it is being re-assigned later in the two paths of an if statement. The early initialization is redundant and can be removed. Link: https://lkml.kernel.org/r/20220112230411.1090761-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton --- fs/ocfs2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ocfs2/dir.c~ocfs2-remove-redundant-assignment-to-variable-free_space +++ a/fs/ocfs2/dir.c @@ -3343,7 +3343,7 @@ static int ocfs2_find_dir_space_id(struc struct ocfs2_dir_entry *de, *last_de = NULL; char *de_buf, *limit; unsigned long offset = 0; - unsigned int rec_len, new_rec_len, free_space = dir->i_sb->s_blocksize; + unsigned int rec_len, new_rec_len, free_space; /* * This calculates how many free bytes we'd have in block zero, should _