Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4204205pxa; Mon, 10 Aug 2020 03:40:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwddl01xQ61VskeBoi5ZSd1TaEg1eq46FNgeU2BGRpyB1oAt9zJIYVcdwrQ1P3E3K7pKTyN X-Received: by 2002:a17:906:9356:: with SMTP id p22mr20659149ejw.119.1597056035652; Mon, 10 Aug 2020 03:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597056035; cv=none; d=google.com; s=arc-20160816; b=Mz8ZGresgPxQS4eVBVC23JU/EUqGH0RUj9V/d3eHBp9jOGvBg66KSkKctb0YqNepjh 4w0Jenwvl7elNAhN4vqbV/TvGE7ud6j7BLYMJPkNPKN/XrJf7GIUews+knSFzM3BrVdI PU9uvcU5vFX3xyTtP1jsu136E2oBZBgLpoHNCT5tBD6lWHF7lKlfY/fEe5t0rmqYaIbC QhnU8CCocC5KIC0T2uC1UKmImStCkJgSjA7YIfXNmd0GJdY3XLVYpjvuE49Un0WtX0kc Z9qbAElg37P3WdUcfAbFczGLIpKz5fql099+jOcKewnNfUQ9L54UKzXzFC+1ho/4gldB Wj1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q+/qq8n7xpfriYAYGcXAa4s7z/LGvzsmbwutdOAli2U=; b=SkE/z3Rw2DtuGJuDhUh6G03OkeX+IGbeSfQjHw2idseclGavVtzyAEX8VRwdYYpZlh VZRPpL4usRC62tjnwE85tvxtCXGSPG1shWFTH/HrBDhl2M58he1tdsg7/C0obrrJwq6t ht+TDeV3xjR98exWBWCbbUISbRu/vqk7DyY8cF50Ox8CQfDQ2U5056rD0r+9/56C7Jta 4BO3ve6W2q5Pp2WVUavmtCmgWLVE/GzlxAlasc6PAPBQAG5yU7XG+tGMAmHGKsFMZ8Ut qiZJWveGD7W5P9y8YPyhHoBhpKtzJbHRrdQZUpKO7kCk/4eo9ysRRMOFYmW3Dys+yq2F EEpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si844110ejy.492.2020.08.10.03.40.12; Mon, 10 Aug 2020 03:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726339AbgHJKjC (ORCPT + 99 others); Mon, 10 Aug 2020 06:39:02 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9357 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726141AbgHJKjC (ORCPT ); Mon, 10 Aug 2020 06:39:02 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id CA3FDE0191CA346124EE; Mon, 10 Aug 2020 18:38:59 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Mon, 10 Aug 2020 18:38:49 +0800 From: Chao Yu To: CC: , , , Chao Yu , kernel test robot Subject: [PATCH] f2fs: fix compile warning Date: Mon, 10 Aug 2020 18:38:45 +0800 Message-ID: <20200810103845.37649-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes below compile warning reported by LKP (kernel test robot) cppcheck warnings: (new ones prefixed by >>) >> fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false [identicalConditionAfterEarlyExit] return err; ^ fs/f2fs/file.c:753:6: note: first condition if (err) ^ fs/f2fs/file.c:761:9: note: second condition return err; Reported-by: kernel test robot Signed-off-by: Chao Yu --- fs/f2fs/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 8a422400e824..f16120352f0c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -753,11 +753,14 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) return err; #ifdef CONFIG_F2FS_FS_COMPRESSION - if (from != free_from) + if (from != free_from) { err = f2fs_truncate_partial_cluster(inode, from, lock); + if (err) + return err; + } #endif - return err; + return 0; } int f2fs_truncate(struct inode *inode) -- 2.26.2