Skip to content

Commit 4df7a75

Browse files
JasonYanHwkees
authored andcommitted
f2fs: Eliminate usage of uninitialized_var() macro
This is an effort to eliminate the uninitialized_var() macro[1]. The use of this macro is the wrong solution because it forces off ANY analysis by the compiler for a given variable. It even masks "unused variable" warnings. Quoted from Linus[2]: "It's a horrible thing to use, in that it adds extra cruft to the source code, and then shuts up a compiler warning (even the _reliable_ warnings from gcc)." Fix it by remove this variable since it is not needed at all. [1] KSPP#81 [2] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ Suggested-by: Chao Yu <[email protected]> Signed-off-by: Jason Yan <[email protected]> Reviewed-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 4a2b958 commit 4df7a75

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/f2fs/data.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,7 +2856,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
28562856
};
28572857
#endif
28582858
int nr_pages;
2859-
pgoff_t uninitialized_var(writeback_index);
28602859
pgoff_t index;
28612860
pgoff_t end; /* Inclusive */
28622861
pgoff_t done_index;
@@ -2875,8 +2874,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
28752874
clear_inode_flag(mapping->host, FI_HOT_DATA);
28762875

28772876
if (wbc->range_cyclic) {
2878-
writeback_index = mapping->writeback_index; /* prev offset */
2879-
index = writeback_index;
2877+
index = mapping->writeback_index; /* prev offset */
28802878
end = -1;
28812879
} else {
28822880
index = wbc->range_start >> PAGE_SHIFT;

0 commit comments

Comments
 (0)