use template max() instead of max_c() macro

This commit is contained in:
Marcus Overhagen 2012-09-14 20:20:29 +02:00
parent 87b33446e1
commit 1f6d0a79c9

View File

@ -6,6 +6,7 @@
#include "ahci_controller.h"
#include "util.h"
#include <algorithm>
#include <KernelExport.h>
#include <stdio.h>
#include <string.h>
@ -281,7 +282,7 @@ AHCIController::ResetController()
if (fPCIVendorID == PCI_VENDOR_INTEL) {
// Intel PCS—Port Control and Status
// SATA port enable bits must be set
int portCount = max_c(fls(fRegs->pi), 1 + (int)((fRegs->cap >> CAP_NP_SHIFT) & CAP_NP_MASK));
int portCount = std::max(fls(fRegs->pi), 1 + (int)((fRegs->cap >> CAP_NP_SHIFT) & CAP_NP_MASK));
if (portCount > 8) {
// TODO: fix this when specification available
TRACE("don't know how to enable SATA ports 9 to %d\n", portCount);