diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-11-25 09:42:58 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-11-25 09:42:58 +0100 |
commit | 2f7f4d17d84514edc6b1368303818e8b0eaa9bf4 (patch) | |
tree | 6d997af60393b6e0f1ea12826f0a942e808891da | |
parent | 4dd867cefc0523e40abc93401a633aa0941a27a2 (diff) |
ahci: save a few loop hops in detectahci
-rw-r--r-- | src/ahci.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |