From: Andrew Morton <akpm@linux-foundation.org>
To: Bharath Vedartham <linux.bhar@gmail.com>
Cc: jannh@google.com, reiserfs-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] reiserfs: Force type conversion in xattr_hash
Date: Thu, 18 Apr 2019 15:50:19 -0700 [thread overview]
Message-ID: <20190418155019.ab5189e4e317df2b36861012@linux-foundation.org> (raw)
In-Reply-To: <20190417115200.GA10168@bharath12345-Inspiron-5559>
On Wed, 17 Apr 2019 17:22:00 +0530 Bharath Vedartham <linux.bhar@gmail.com> wrote:
> 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.
>
> ...
>
> --- 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,
hm. Conversion from int to __u32 should be OK - why is sparse being so
picky here?
Why is the __force needed, btw?
next prev parent reply other threads:[~2019-04-18 22:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 11:52 [PATCH] reiserfs: Force type conversion in xattr_hash Bharath Vedartham
2019-04-18 22:50 ` Andrew Morton [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190418155019.ab5189e4e317df2b36861012@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux.bhar@gmail.com \
--cc=reiserfs-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox