diff mbox series

[f2fs-dev,2/2] f2fs: fix macro definition stat_inc_cp_count

Message ID 20240721131739.260027-2-sunjunchao2870@gmail.com (mailing list archive)
State Superseded
Headers show
Series [f2fs-dev,1/2] f2fs: fix macro definition on_f2fs_build_free_nids | expand

Commit Message

Julian Sun July 21, 2024, 1:17 p.m. UTC
The macro stat_inc_cp_count accepts a parameter si,
but it was not used, rather the variable sbi was directly used,
which may be a local variable inside a function that calls the macros.

Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
---
 fs/f2fs/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chao Yu July 22, 2024, 1:33 a.m. UTC | #1
On 2024/7/21 21:17, Julian Sun wrote:
> The macro stat_inc_cp_count accepts a parameter si,
> but it was not used, rather the variable sbi was directly used,
> which may be a local variable inside a function that calls the macros.
> 
> Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
> ---
>   fs/f2fs/f2fs.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 8a9d910aa552..c9925d1ca2df 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -3987,7 +3987,7 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
>   
>   #define stat_inc_cp_call_count(sbi, foreground)				\
>   		atomic_inc(&sbi->cp_call_count[(foreground)])
> -#define stat_inc_cp_count(si)		(F2FS_STAT(sbi)->cp_count++)
> +#define stat_inc_cp_count(_sbi)		(F2FS_STAT(_sbi)->cp_count++)

Let's use sbi instead of _sbi.

Thanks,

>   #define stat_io_skip_bggc_count(sbi)	((sbi)->io_skip_bggc++)
>   #define stat_other_skip_bggc_count(sbi)	((sbi)->other_skip_bggc++)
>   #define stat_inc_dirty_inode(sbi, type)	((sbi)->ndirty_inode[type]++)
diff mbox series

Patch

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 8a9d910aa552..c9925d1ca2df 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3987,7 +3987,7 @@  static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
 
 #define stat_inc_cp_call_count(sbi, foreground)				\
 		atomic_inc(&sbi->cp_call_count[(foreground)])
-#define stat_inc_cp_count(si)		(F2FS_STAT(sbi)->cp_count++)
+#define stat_inc_cp_count(_sbi)		(F2FS_STAT(_sbi)->cp_count++)
 #define stat_io_skip_bggc_count(sbi)	((sbi)->io_skip_bggc++)
 #define stat_other_skip_bggc_count(sbi)	((sbi)->other_skip_bggc++)
 #define stat_inc_dirty_inode(sbi, type)	((sbi)->ndirty_inode[type]++)