summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/InodeFile.cpp
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-11-14 15:43:43 -0700
committerAndreas Kling <kling@serenityos.org>2021-11-16 00:13:22 +0100
commit7243bcb7da80357210db2aaf57094878b5208db0 (patch)
treeeab01970b6b50b023cc97b487a1579b041dcd3f5 /Kernel/FileSystem/InodeFile.cpp
parent194456efdcdeb67c34a9e255385c777ea411b308 (diff)
downloadserenity-7243bcb7da80357210db2aaf57094878b5208db0.zip
Kernel: Use static_ptr_cast to convert between Userspace<T*> types
Some calls of copy_to_user were converting Userspace<T*> to Userspace<U*> via the implicit conversion to FlatPtr. Change them to use the static_ptr_cast overload that is designed to express this conversion
Diffstat (limited to 'Kernel/FileSystem/InodeFile.cpp')
-rw-r--r--Kernel/FileSystem/InodeFile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/InodeFile.cpp b/Kernel/FileSystem/InodeFile.cpp
index f72f7ffd12..ad252f1d24 100644
--- a/Kernel/FileSystem/InodeFile.cpp
+++ b/Kernel/FileSystem/InodeFile.cpp
@@ -74,7 +74,7 @@ ErrorOr<void> InodeFile::ioctl(OpenFileDescription& description, unsigned reques
}
case FIONREAD: {
int remaining_bytes = inode().size() - description.offset();
- return copy_to_user(Userspace<int*>(arg), &remaining_bytes);
+ return copy_to_user(static_ptr_cast<int*>(arg), &remaining_bytes);
}
default:
return EINVAL;