grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] disk/ahci: Use defines `GRUB_ATA_STATUS_BUSY` and `GRUB_ATA_STATUS_DRQ`
@ 2015-05-24 14:48 Paul Menzel
  2015-05-24 18:19 ` Andrei Borzenkov
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Menzel @ 2015-05-24 14:48 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]

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(-)

diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c
index d6bdbdd..7f75724 100644
--- a/grub-core/disk/ahci.c
+++ b/grub-core/disk/ahci.c
@@ -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];
-- 
2.1.4

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-24 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-24 14:48 [PATCH] disk/ahci: Use defines `GRUB_ATA_STATUS_BUSY` and `GRUB_ATA_STATUS_DRQ` Paul Menzel
2015-05-24 18:19 ` Andrei Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).