summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-11-25 09:42:58 +0100
committerGerd Hoffmann <kraxel@redhat.com>2010-11-25 09:42:58 +0100
commit2f7f4d17d84514edc6b1368303818e8b0eaa9bf4 (patch)
tree6d997af60393b6e0f1ea12826f0a942e808891da
parent4dd867cefc0523e40abc93401a633aa0941a27a2 (diff)
ahci: save a few loop hops in detectahci
-rw-r--r--src/ahci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ahci.c b/src/ahci.c
index a0099f1..9633951 100644
--- a/src/ahci.c
+++ b/src/ahci.c
@@ -412,10 +412,11 @@ ahci_detect(void *data)
{
struct ahci_ctrl_s *ctrl = data;
struct ahci_port_s *port;
- u32 pnr;
+ u32 pnr, max;
int rc;
- for (pnr = 0; pnr < 32; pnr++) {
+ max = ctrl->caps & 0x1f;
+ for (pnr = 0; pnr < max; pnr++) {
if (!(ctrl->ports & (1 << pnr)))
continue;
dprintf(2, "AHCI/%d: probing\n", pnr);