mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
AHCI: Use count_set_bits from BitUtils.
No behavioral change intended.
This commit is contained in:
parent
b54510c378
commit
b4ccd21229
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user