reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reiserfs: Force type conversion in xattr_hash
@ 2019-04-17 11:52 Bharath Vedartham
  2019-04-18 22:50 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Bharath Vedartham @ 2019-04-17 11:52 UTC (permalink / raw)
  To: akpm, jannh; +Cc: reiserfs-devel, linux-kernel

This patch fixes the sparse warning:

fs/reiserfs//xattr.c:453:28: warning: incorrect type in return
expression (different base types)
fs/reiserfs//xattr.c:453:28:    expected unsigned int
fs/reiserfs//xattr.c:453:28:    got restricted __wsum
fs/reiserfs//xattr.c:453:28: warning: incorrect type in return
expression (different base types)
fs/reiserfs//xattr.c:453:28:    expected unsigned int
fs/reiserfs//xattr.c:453:28:    got restricted __wsum

csum_partial returns restricted integer __wsum whereas xattr_hash
expects a return type of __u32.

Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
---
 fs/reiserfs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 32d8986..60b29a0 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -450,7 +450,7 @@ static struct page *reiserfs_get_page(struct inode *dir, size_t n)
 
 static inline __u32 xattr_hash(const char *msg, int len)
 {
-	return csum_partial(msg, len, 0);
+	return (__force __u32)csum_partial(msg, len, 0);
 }
 
 int reiserfs_commit_write(struct file *f, struct page *page,
-- 
2.7.4


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

end of thread, other threads:[~2019-04-23 15:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-17 11:52 [PATCH] reiserfs: Force type conversion in xattr_hash Bharath Vedartham
2019-04-18 22:50 ` Andrew Morton
2019-04-19  6:08   ` Bharath Vedartham
2019-04-21 17:02   ` Al Viro
2019-04-22 19:27     ` Andrew Morton
2019-04-23 14:55       ` Bharath Vedartham
2019-04-23 14:52     ` Bharath Vedartham
2019-04-23 15:16       ` Al Viro

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