1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:17:34 +00:00

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.
This commit is contained in:
Alexander 2021-06-25 15:45:11 +02:00 committed by Andreas Kling
parent f17b4e561f
commit e9b7d58d10

View file

@ -144,8 +144,8 @@ public:
void set_at(u8 index) const void set_at(u8 index) const
{ {
VERIFY(((1 << index) & m_bit_mask) != 0); VERIFY(((1u << index) & m_bit_mask) != 0);
m_bitfield = m_bitfield | ((1 << index) & m_bit_mask); m_bitfield = m_bitfield | ((1u << index) & m_bit_mask);
} }
void set_all() const void set_all() const
@ -153,9 +153,9 @@ public:
m_bitfield = m_bitfield | (0xffffffff & m_bit_mask); 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 bool is_zeroed() const