disk/ahci: Use defines `GRUB_ATA_STATUS_BUSY` and `GRUB_ATA_STATUS_DRQ`
PATCH 1/1 disk/ahci: Use defines `GRUB_ATA_STATUS_BUSY` and `GRUB_ATA_STATUS_DRQ`
Date: Sun, 24 May 2015 11:11:25 +0200
Instead of hard coding 0x88 use the macros defined in disk/ata.h.
--- grub-core/disk/ahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
grub-core/disk/ahci.c +2 -2
@@ -565,14 +565,14 @@ grub_ahci_pciinit (grub_pci_device_t dev,while (grub_get_time_ms () < endtime) {for (i =0 ; i < nports; i++) -if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data &0x88 )) +if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY |GRUB_ATA_STATUS_DRQ )))break ;if (i == nports)break ; }for (i =0 ; i < nports; i++) -if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data &0x88 )) +if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY |GRUB_ATA_STATUS_DRQ ))) {grub_dprintf ("ahci" ,"port %d is busy\n" , i); failed_adevs[i] = adevs[i];
Signature · 1 line
2.1.4
Andrei Borzenkov
AppliedВ Sun, 24 May 2015 16:48:42 +0200
Paul Menzel <[email protected]> пишет:
Quoted 3 lines
Date: Sun, 24 May 2015 11:11:25 +0200
Instead of hard coding
0x88use the macros defined indisk/ata.h.
applied
Quoted 25 lines
--- grub-core/disk/ahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)grub-core/disk/ahci.c +2
-2@@ -565,14 +565,14 @@ grub_ahci_pciinit (grub_pci_device_t dev,while (grub_get_time_ms () < endtime) {for (i =0 ; i < nports; i++) -if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data &0x88 )) +if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY |GRUB_ATA_STATUS_DRQ )))break ;if (i == nports)break ; }for (i =0 ; i < nports; i++) -if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data &0x88 )) +if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY |GRUB_ATA_STATUS_DRQ ))) {grub_dprintf ("ahci" ,"port %d is busy\n" , i); failed_adevs[i] = adevs[i];