From: Christoph Hellwig <hch@lst.de>
To: Coly Li <colyli@suse.de>
Cc: kernel test robot <lkp@intel.com>, Christoph Hellwig <hch@lst.de>,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>
Subject: Re: drivers/md/bcache/super.c:108:14: sparse: sparse: restricted __le64 degrades to integer
Date: Thu, 12 Dec 2024 07:23:53 +0100 [thread overview]
Message-ID: <20241212062353.GB5586@lst.de> (raw)
In-Reply-To: <33E9C2B1-BF96-46DD-BE45-00811C986ABD@suse.de>
On Wed, Dec 11, 2024 at 12:34:20AM +0800, Coly Li wrote:
> > drivers/md/bcache/super.c:108:24: sparse: expected unsigned int nr_keys
> > drivers/md/bcache/super.c:108:24: sparse: got restricted __le16 [usertype] keys
> >>> drivers/md/bcache/super.c:108:14: sparse: sparse: restricted __le64 degrades to integer
>
> It complains about line 108 which is,
> > cafe563591446cf Kent Overstreet 2013-03-23 107 err = "Bad checksum";
> > cafe563591446cf Kent Overstreet 2013-03-23 @108 if (s->csum != csum_set(s))
> > cafe563591446cf Kent Overstreet 2013-03-23 109 goto err;
>
> Here s->sum is __le64, csum_set() is uint64_t, these two types have same length. I don’t see the direct connection between code and warning.
The are the same size, but not the same endianess. In other words this
is a hint that this code is most likely broken on big endian systems
due to the lack of a bytespace (which is a no-op on little endian
systems).
next prev parent reply other threads:[~2024-12-12 6:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 4:00 drivers/md/bcache/super.c:108:14: sparse: sparse: restricted __le64 degrades to integer kernel test robot
2024-12-10 16:34 ` Coly Li
2024-12-12 6:23 ` Christoph Hellwig [this message]
2024-12-12 17:45 ` Coly Li
-- strict thread matches above, loose matches on Subject: below --
2024-12-06 1:15 kernel test robot
2023-11-11 12:55 kernel test robot
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=20241212062353.GB5586@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=colyli@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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