Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdIJLPr (ORCPT ); Sun, 10 Sep 2017 07:15:47 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5578 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbdIJLPq (ORCPT ); Sun, 10 Sep 2017 07:15:46 -0400 From: Yunlong Song To: , , , , CC: , , , , , Subject: [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value Date: Sun, 10 Sep 2017 19:15:29 +0800 Message-ID: <1505042129-41945-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.59B51EE0.00A0,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6b118976745d398b083e60cae725557b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 711 Lines: 23 If flag bit to check is in 0xFFFFFF00, then the return value will be false, this is not correct, so fix it. Signed-off-by: Yunlong Song --- fsck/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index 871cffc..de03512 100644 --- a/fsck/f2fs.h +++ b/fsck/f2fs.h @@ -276,7 +276,7 @@ static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag) static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) { unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); - return ckpt_flags & f; + return ckpt_flags & f ? 1 : 0; } static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi) -- 1.8.5.2