Skip to contentSkip to conversation

f2fs: remove duplicated type casting

PATCH In review w00407079 2 participants 2 messages Aug 4, 2020 – Aug 5, 2020 F2FS file system

lore
Share & tools
lore

w00407079

author
#0 lore raw

PATCH 1/1 f2fs: remove duplicated type casting

From: Xiaojun Wang <[email protected]>

Since DUMMY_WRITTEN_PAGE and ATOMIC_WRITTEN_PAGE have already been converted as unsigned long type, we don't need do type casting again.

---
 fs/f2fs/data.c    | 2 +-
 fs/f2fs/f2fs.h    | 4 ++--
 fs/f2fs/segment.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
fs/f2fs/data.c +1 -1
index b9642607c07d..30574747374b 100644
@@ -517,7 +517,7 @@ static inline void __submit_bio(struct f2fs_sb_info *sbi,
 
 			zero_user_segment(page, 0, PAGE_SIZE);
 			SetPagePrivate(page);
-			set_page_private(page, (unsigned long)DUMMY_WRITTEN_PAGE);
+			set_page_private(page, DUMMY_WRITTEN_PAGE);
 			lock_page(page);
 			if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE)
 				f2fs_bug_on(sbi, 1);
fs/f2fs/f2fs.h +2 -2
index b35a50f4953c..7ad77bf4b1d9 100644
@@ -1309,9 +1309,9 @@ enum fsync_mode {
 #define DUMMY_WRITTEN_PAGE		((unsigned long)-2)
 
 #define IS_ATOMIC_WRITTEN_PAGE(page)			\
-		(page_private(page) == (unsigned long)ATOMIC_WRITTEN_PAGE)
+		(page_private(page) == ATOMIC_WRITTEN_PAGE)
 #define IS_DUMMY_WRITTEN_PAGE(page)			\
-		(page_private(page) == (unsigned long)DUMMY_WRITTEN_PAGE)
+		(page_private(page) == DUMMY_WRITTEN_PAGE)
 
 #ifdef CONFIG_FS_ENCRYPTION
 #define DUMMY_ENCRYPTION_ENABLED(sbi) \
fs/f2fs/segment.c +1 -1
index 196f31503511..37c8d2a25b88 100644
@@ -189,7 +189,7 @@ void f2fs_register_inmem_page(struct inode *inode, struct page *page)
 
 	f2fs_trace_pid(page);
 
-	f2fs_set_page_private(page, (unsigned long)ATOMIC_WRITTEN_PAGE);
+	f2fs_set_page_private(page, ATOMIC_WRITTEN_PAGE);
 
 	new = f2fs_kmem_cache_alloc(inmem_entry_slab, GFP_NOFS);
 
Signature · 8 lines
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On 2020/8/4 21:46, w00407079 wrote:

From: Xiaojun Wang <[email protected]>

Since DUMMY_WRITTEN_PAGE and ATOMIC_WRITTEN_PAGE have already been converted as unsigned long type, we don't need do type casting again.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel