Skip to contentSkip to conversation

drivers/ata/ahci build break.

PATCH In review Sachin Sant 3 participants 4 messages Oct 9, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/ata/ahci build break.

On a Powerpc box latest git (2.6.32-rc3-git2: 36a07902...) failed to build with following error :

drivers/ata/ahci.c: In function 'ahci_gtf_filter_workaround':
drivers/ata/ahci.c:2927: error: 'struct ata_device' has no member named 'gtf_filter'
make[2]: *** [drivers/ata/ahci.o] Error 1

The code was introduced by f80ae7e45a0e03da188494c6e947a5c8b0cdfb4a.

CONFIG_ATA_ACPI is not set in this case.

The following patch fixes the build break for me.

---

With !CONFIG_ATA_ACPI drivers/ata build breaks with following error

drivers/ata/ahci.c: In function 'ahci_gtf_filter_workaround':
drivers/ata/ahci.c:2927: error: 'struct ata_device' has no member named 'gtf_filter'
make[2]: *** [drivers/ata/ahci.o] Error 1

Box the function within CONFIG_ATA_ACPI.

---

drivers/ata/ahci.c +4 -0
diff -Naurp old/drivers/ata/ahci.c new/drivers/ata/ahci.c
@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pc
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
 
+#ifdef CONFIG_ATA_ACPI
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
 	static const struct dmi_system_id sysids[] = {
@@ -2927,6 +2928,7 @@ static void ahci_gtf_filter_workaround(s
 				dev->gtf_filter |= filter;
 	}
 }
+#endif
 
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
@@ -3093,8 +3095,10 @@ static int ahci_init_one(struct pci_dev
 	/* apply workaround for ASUS P5W DH Deluxe mainboard */
 	ahci_p5wdh_workaround(host);
 
+#ifdef CONFIG_ATA_ACPI
 	/* apply gtf filter quirk */
 	ahci_gtf_filter_workaround(host);
+#endif
 
 	/* initialize adapter */
 	rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
#1 lore raw
Quoted 17 lines · Sachin Sant
drivers/ata/ahci.c +2 -0
@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pc
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
 
+#ifdef CONFIG_ATA_ACPI
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
 	static const struct dmi_system_id sysids[] = {
@@ -2927,6 +2928,7 @@ static void ahci_gtf_filter_workaround(s
 				dev->gtf_filter |= filter;
 	}
 }
+#endif
 
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {

drivers/ata/ahci.c static int ahci_init_one(struct pci_dev · line 3101

Quoted 7 lines
drivers/ata/ahci.c +2 -0
@@ -3093,8 +3095,10 @@ static int ahci_init_one(struct pci_dev
 	/* apply workaround for ASUS P5W DH Deluxe mainboard */
 	ahci_p5wdh_workaround(host);
 
+#ifdef CONFIG_ATA_ACPI
 	/* apply gtf filter quirk */
 	ahci_gtf_filter_workaround(host);
+#endif

The usual way to do this is to make sure there's a dummy ahci_gtf_filter_workaround so there doesn't have to be that ifdef in the caller. This is probably easier to do like this:

@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pc
return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
}

static void ahci_gtf_filter_workaround(struct ata_host *host) {
+#ifdef CONFIG_ATA_ACPI
static const struct dmi_system_id sysids[] = {
@@ -2927,6 +2928,7 @@ static void ahci_gtf_filter_workaround(s
dev->gtf_filter |= filter;
}
+#endif
}

static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) {

Signature · 4 lines
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
#2 lore raw
Quoted 13 lines · Matthew Wilcox

The usual way to do this is to make sure there's a dummy ahci_gtf_filter_workaround so there doesn't have to be that ifdef in the caller. This is probably easier to do like this:

drivers/ata/ahci.c +1 -0
@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pc
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
 
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
+#ifdef CONFIG_ATA_ACPI
 	static const struct dmi_system_id sysids[] = {

drivers/ata/ahci.c static void ahci_gtf_filter_workaround(s · line 2931

Quoted 4 lines
drivers/ata/ahci.c +1 -0
@@ -2927,6 +2928,7 @@ static void ahci_gtf_filter_workaround(s
 				dev->gtf_filter |= filter;
 	}
+#endif
 }

Fix is already included in Jeff's tree.

Thanks.

Signature · 1 line
tejun
#3 lore raw
Quoted 23 lines · Tejun Heo
Quoted 13 lines · Matthew Wilcox

The usual way to do this is to make sure there's a dummy ahci_gtf_filter_workaround so there doesn't have to be that ifdef in the caller. This is probably easier to do like this:

drivers/ata/ahci.c +1 -0
@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pc
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
 
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
+#ifdef CONFIG_ATA_ACPI
 	static const struct dmi_system_id sysids[] = {

drivers/ata/ahci.c static void ahci_gtf_filter_workaround(s · line 2932

Quoted 5 lines
drivers/ata/ahci.c +1 -0
@@ -2927,6 +2928,7 @@ static void ahci_gtf_filter_workaround(s
 				dev->gtf_filter |= filter;
 	}
+#endif
 }
 

Fix is already included in Jeff's tree.

Quoted 3 lines

Thanks.

Ah Thanks.

Regards
-Sachin

Signature · 6 lines
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------