Skip to content

Commit

Permalink
Kernel/AHCI: Fix shift of 1
Browse files Browse the repository at this point in the history
This makes the 1 in the shift unsigned.
This also changes the is_set_at parameter to be a u8.
  • Loading branch information
ElectrodeYT authored and awesomekling committed Jun 25, 2021
1 parent f17b4e5 commit e9b7d58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Kernel/Storage/AHCI.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,18 @@ class MaskedBitField {

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
{
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
Expand Down

0 comments on commit e9b7d58

Please sign in to comment.