Skip to contentSkip to conversation

f2fs: fix sparse warnings

PATCH New Jaegeuk Kim 1 participant 1 message Mar 24, 2015

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: fix sparse warnings

This patch fixes the below warning.

sparse warnings: (new ones prefixed by >>)

Quoted 2 lines
Quoted 2 lines

fs/f2fs/inode.c:56:23: sparse: restricted __le32 degrades to integer fs/f2fs/inode.c:56:52: sparse: restricted __le32 degrades to integer

---
 fs/f2fs/inode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/inode.c +3 -1
index 07237ac..e622ec9 100644
@@ -53,7 +53,9 @@ static void __get_inode_rdev(struct inode *inode, struct f2fs_inode *ri)
 
 static bool __written_first_block(struct f2fs_inode *ri)
 {
-	if (ri->i_addr[0] != NEW_ADDR && ri->i_addr[0] != NULL_ADDR)
+	block_t addr = le32_to_cpu(ri->i_addr[0]);
+
+	if (addr != NEW_ADDR && addr != NULL_ADDR)
 		return true;
 	return false;
 }
Signature · 9 lines
2.1.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/