mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
Kernel: Make File's can_read/can_write take a const FileDescription&
Asking a File if we could possibly read or write it will never mutate the asking FileDescription&, so it should be const.
This commit is contained in:
parent
e8fee92357
commit
1b2ef8582c
47 changed files with 97 additions and 91 deletions
|
@ -12,7 +12,7 @@ SerialDevice::~SerialDevice()
|
|||
{
|
||||
}
|
||||
|
||||
bool SerialDevice::can_read(FileDescription&) const
|
||||
bool SerialDevice::can_read(const FileDescription&) const
|
||||
{
|
||||
return (get_line_status() & DataReady) != 0;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ ssize_t SerialDevice::read(FileDescription&, u8* buffer, ssize_t size)
|
|||
return 1;
|
||||
}
|
||||
|
||||
bool SerialDevice::can_write(FileDescription&) const
|
||||
bool SerialDevice::can_write(const FileDescription&) const
|
||||
{
|
||||
return (get_line_status() & EmptyTransmitterHoldingRegister) != 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue