AK+Kernel: Remove implicit conversion from Userspace<T*> to FlatPtr

This feels like it was a refactor transition kind of conversion. The
places that were relying on it can easily be changed to explicitly ask
for the ptr() or a new vaddr() method on Userspace<T*>.

FlatPtr can still implicitly convert to Userspace<T> because the
constructor is not explicit, but there's quite a few more places that
are relying on that conversion.
This commit is contained in:
Andrew Kaster 2021-11-14 15:52:48 -07:00 committed by Andreas Kling
commit f1d8978804
Notes: sideshowbarker 2024-07-18 01:05:47 +09:00
5 changed files with 14 additions and 11 deletions

View file

@ -15,7 +15,7 @@
ErrorOr<NonnullOwnPtr<Kernel::KString>> try_copy_kstring_from_user(Userspace<const char*> user_str, size_t user_str_size)
{
bool is_user = Kernel::Memory::is_user_range(VirtualAddress(user_str), user_str_size);
bool is_user = Kernel::Memory::is_user_range(user_str.vaddr(), user_str_size);
if (!is_user)
return EFAULT;
Kernel::SmapDisabler disabler;