Re: [PATCH] btrfs: Replace kmap() with kmap_local_page() in zstd.c

From: David Sterba
Date: Thu Jul 14 2022 - 08:38:13 EST


On Thu, Jul 14, 2022 at 08:25:20AM +0800, Wang Yugui wrote:
> Hi,
>
> Compiler warning:
>
> fs/btrfs/zstd.c:478:55: warning: passing argument 1 of ‘__kunmap_local’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
> 478 | kunmap_local(workspace->in_buf.src);
> ./include/linux/highmem-internal.h:284:24: note: in definition of macro ‘kunmap_local’
> 284 | __kunmap_local(__addr); \
> | ^~~~~~
> ./include/linux/highmem-internal.h:200:41: note: expected ‘void *’ but argument is of type ‘const void *’
> 200 | static inline void __kunmap_local(void *addr)
> | ~~~~~~^~~~

This requires patch
https://lore.kernel.org/all/20220706111520.12858-2-fmdefrancesco@xxxxxxxxx/
that adds const to kmap/kunmap API.