AHCI: Use count_set_bits from BitUtils.

No behavioral change intended.
This commit is contained in:
Augustin Cavalier 2024-10-21 12:57:39 -04:00
parent b54510c378
commit b4ccd21229
2 changed files with 1 additions and 11 deletions

View File

@ -218,7 +218,7 @@ AHCIController::Init()
}
TRACE("ghc: AHCI Enable: %s\n", (fRegs->ghc & GHC_AE) ? "yes" : "no");
TRACE("Ports Implemented Mask: %#08" B_PRIx32 " Number of Available Ports:"
" %d\n", fPortImplementedMask, count_bits_set(fPortImplementedMask));
" %d\n", fPortImplementedMask, count_set_bits(fPortImplementedMask));
TRACE("AHCI Version %02" B_PRIx32 "%02" B_PRIx32 ".%02" B_PRIx32 ".%02"
B_PRIx32 " Interrupt %" B_PRIu32 "\n", fRegs->vs >> 24, (fRegs->vs >> 16) & 0xff,
(fRegs->vs >> 8) & 0xff, fRegs->vs & 0xff, fIRQ);

View File

@ -344,16 +344,6 @@ extern scsi_for_sim_interface *gSCSI;
#ifdef __cplusplus
template <class T>
int count_bits_set(T value)
{
int count = 0;
for (T mask = 1; mask; mask <<= 1)
if (value & mask)
count++;
return count;
}
inline
status_t
wait_until_set(volatile uint32 *reg, uint32 bits, bigtime_t timeout)