summaryrefslogtreecommitdiff
path: root/Kernel/Devices/Audio
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 20:17:49 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 22:41:17 +0200
commit9ce537d7036bf4aff61d4ce10e7fe0b134c122b3 (patch)
tree3dc45992db0acbfad56c0555821909432a1f86cd /Kernel/Devices/Audio
parent0c630d568721f1efba2d5c0ee72c52c08b43d6e8 (diff)
downloadserenity-9ce537d7036bf4aff61d4ce10e7fe0b134c122b3.zip
Kernel: Use u64 instead of size_t for File::can_read offset
This ensures offsets will not be truncated on large files on i686.
Diffstat (limited to 'Kernel/Devices/Audio')
-rw-r--r--Kernel/Devices/Audio/AC97.h2
-rw-r--r--Kernel/Devices/Audio/SB16.cpp2
-rw-r--r--Kernel/Devices/Audio/SB16.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Devices/Audio/AC97.h b/Kernel/Devices/Audio/AC97.h
index aae4c7dc58..36ed77190e 100644
--- a/Kernel/Devices/Audio/AC97.h
+++ b/Kernel/Devices/Audio/AC97.h
@@ -31,7 +31,7 @@ public:
virtual StringView purpose() const override { return class_name(); }
// ^CharacterDevice
- virtual bool can_read(const OpenFileDescription&, size_t) const override { return false; }
+ virtual bool can_read(const OpenFileDescription&, u64) const override { return false; }
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned, Userspace<void*>) override;
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
diff --git a/Kernel/Devices/Audio/SB16.cpp b/Kernel/Devices/Audio/SB16.cpp
index 7256db1807..b654060ba1 100644
--- a/Kernel/Devices/Audio/SB16.cpp
+++ b/Kernel/Devices/Audio/SB16.cpp
@@ -184,7 +184,7 @@ void SB16::set_irq_line(u8 irq_number)
change_irq_number(irq_number);
}
-bool SB16::can_read(OpenFileDescription const&, size_t) const
+bool SB16::can_read(OpenFileDescription const&, u64) const
{
return false;
}
diff --git a/Kernel/Devices/Audio/SB16.h b/Kernel/Devices/Audio/SB16.h
index fe596b5204..5331b97847 100644
--- a/Kernel/Devices/Audio/SB16.h
+++ b/Kernel/Devices/Audio/SB16.h
@@ -26,7 +26,7 @@ public:
static RefPtr<SB16> try_detect_and_create();
// ^CharacterDevice
- virtual bool can_read(const OpenFileDescription&, size_t) const override;
+ virtual bool can_read(const OpenFileDescription&, u64) const override;
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }