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
Notes: sideshowbarker 2024-07-18 11:32:58 +09:00

View file

@ -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