AHCI: Use count_set_bits from BitUtils.
No behavioral change intended.
This commit is contained in:
@@ -218,7 +218,7 @@ AHCIController::Init()
|
|||||||
}
|
}
|
||||||
TRACE("ghc: AHCI Enable: %s\n", (fRegs->ghc & GHC_AE) ? "yes" : "no");
|
TRACE("ghc: AHCI Enable: %s\n", (fRegs->ghc & GHC_AE) ? "yes" : "no");
|
||||||
TRACE("Ports Implemented Mask: %#08" B_PRIx32 " Number of Available Ports:"
|
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"
|
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,
|
B_PRIx32 " Interrupt %" B_PRIu32 "\n", fRegs->vs >> 24, (fRegs->vs >> 16) & 0xff,
|
||||||
(fRegs->vs >> 8) & 0xff, fRegs->vs & 0xff, fIRQ);
|
(fRegs->vs >> 8) & 0xff, fRegs->vs & 0xff, fIRQ);
|
||||||
|
|||||||
@@ -344,16 +344,6 @@ extern scsi_for_sim_interface *gSCSI;
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#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
|
inline
|
||||||
status_t
|
status_t
|
||||||
wait_until_set(volatile uint32 *reg, uint32 bits, bigtime_t timeout)
|
wait_until_set(volatile uint32 *reg, uint32 bits, bigtime_t timeout)
|
||||||
|
|||||||
Reference in New Issue
Block a user