Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751289AbdILBMX (ORCPT ); Mon, 11 Sep 2017 21:12:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6011 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbdILBMW (ORCPT ); Mon, 11 Sep 2017 21:12:22 -0400 Subject: Re: [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value To: Yunlong Song , , , CC: , , , , , References: <1505042129-41945-1-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: <57e1432e-63bb-9190-d31e-6a425610d813@huawei.com> Date: Tue, 12 Sep 2017 09:11:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1505042129-41945-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.59B73459.003A,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: c368fd09214e573ef35b762500f7d0aa Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 828 Lines: 26 On 2017/9/10 19:15, Yunlong Song wrote: > 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 Reviewed-by: Chao Yu > --- > 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) >