diff options
author | Alexander <electrodeyt@gmail.com> | 2021-06-25 15:45:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-25 16:27:01 +0200 |
commit | e9b7d58d105d780bed65ffefb5e69a62e2ff4ab9 (patch) | |
tree | 67795aafa5b36e564da841f8bc3fade2d4084fa2 /Kernel/Storage/AHCI.h | |
parent | f17b4e561f54f13e160cacebd5d801e68e53e93c (diff) | |
download | serenity-e9b7d58d105d780bed65ffefb5e69a62e2ff4ab9.zip |
Kernel/AHCI: Fix shift of 1
This makes the 1 in the shift unsigned.
This also changes the is_set_at parameter to be a u8.
Diffstat (limited to 'Kernel/Storage/AHCI.h')
-rw-r--r-- | Kernel/Storage/AHCI.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Storage/AHCI.h b/Kernel/Storage/AHCI.h index b0ae6da88a..9502208d3b 100644 --- a/Kernel/Storage/AHCI.h +++ b/Kernel/Storage/AHCI.h @@ -144,8 +144,8 @@ public: void set_at(u8 index) const { - VERIFY(((1 << index) & m_bit_mask) != 0); - m_bitfield = m_bitfield | ((1 << index) & m_bit_mask); + VERIFY(((1u << index) & m_bit_mask) != 0); + m_bitfield = m_bitfield | ((1u << index) & m_bit_mask); } void set_all() const @@ -153,9 +153,9 @@ public: m_bitfield = m_bitfield | (0xffffffff & m_bit_mask); } - bool is_set_at(u32 port_index) const + bool is_set_at(u8 port_index) const { - return m_bitfield & ((1 << port_index) & m_bit_mask); + return m_bitfield & ((1u << port_index) & m_bit_mask); } bool is_zeroed() const |