linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value
@ 2017-09-10 11:15 Yunlong Song
  2017-09-12  1:11 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Yunlong Song @ 2017-09-10 11:15 UTC (permalink / raw)
  To: jaegeuk, chao, yuchao0, yunlong.song, yunlong.song
  Cc: miaoxie, bintian.wang, heyunlei, linux-fsdevel, linux-f2fs-devel,
	linux-kernel

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 <yunlong.song@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value
  2017-09-10 11:15 [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value Yunlong Song
@ 2017-09-12  1:11 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-09-12  1:11 UTC (permalink / raw)
  To: Yunlong Song, jaegeuk, chao, yunlong.song
  Cc: miaoxie, bintian.wang, heyunlei, linux-fsdevel, linux-f2fs-devel,
	linux-kernel

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 <yunlong.song@huawei.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

> ---
>  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)
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-12  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-10 11:15 [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value Yunlong Song
2017-09-12  1:11 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).