On 01.09.25 22:50, Max Kellermann wrote:
Lots of functions in mm/highmem.c do not write to the given pointers
and do not call functions that take non-const pointers and can
therefore be constified.
This includes functions like kunmap() which might be implemented in a
way that writes to the pointer (e.g. to update reference counters or
mapping fields), but currently are not.
kmap() on the other hand cannot be made const because it calls
set_page_address() which is non-const in some
architectures/configurations.
Right, we store the address in page->virtual.
It's interesting that kumap() won't set that field to NULL. That seems
to happen in flush_all_zero_pkmaps(). And we seem to flush during kmap()
in case we have to empty slots.
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
--
Cheers
David / dhildenb