Re: [PATCH 2/8] btrfs: introduce a pure data checksum checking helper

David Sterba
2022-05-25T16:24:47Z

On Tue, May 24, 2022 at 10:11:10AM +0200, Christoph Hellwig wrote:
> On Tue, May 24, 2022 at 04:07:41PM +0800, Qu Wenruo wrote:
> >> - u32 pgoff, u8 *csum, u8 *csum_expected);
> >> + u32 pgoff, u8 *csum, u8 * const csum_expected);
> >
> > Shouldn't it be "const u8 *" instead?
>
> No, that would bind to the pointer. But we care about the data.

Then it could be 'const u8 * const csum_expected'. The consts are not
everywhere I would like them to see so in new code I care a bit more and
add it when applying patches.