lkml.org 
[lkml]   [2004]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: Linux 2.6.3-rc4
Date
On Tuesday 17 of February 2004 09:54, Martin Diehl wrote:
> On Mon, 16 Feb 2004, Linus Torvalds wrote:
> > Bartlomiej Zolnierkiewicz:
> > o make __ide_dma_off() generic and remove ide_hwif_t->ide_dma_off
>
> doesn't build for me:
>
> drivers/built-in.o(.text+0x3aa33): In function `set_using_dma':
> : undefined reference to `__ide_dma_off'
>
> drivers/built-in.o(.text+0x401bc): In function `check_dma_crc':
> : undefined reference to `__ide_dma_off'
>
> make: *** [.tmp_vmlinux1] Error 1

Thanks for spotting this, here's a fix (Linus, please apply).
As a bonus it should decrease your kernel's size by a few bytes ;-).

[PATCH] fix build with CONFIG_BLK_DEV_IDEDMA=n (once again)

My "__ide_dma_off()" cleanup uncovered some code that shouldn't be compiled
when CONFIG_BLK_DEV_IDEDMA=n. Fix it and kill a warning in setup-pci.c.

Noticed by Martin Diehl <lists@mdiehl.de>.

linux-2.6.3-rc3-root/drivers/ide/ide-iops.c | 7 ++++---
linux-2.6.3-rc3-root/drivers/ide/ide.c | 4 ++++
linux-2.6.3-rc3-root/drivers/ide/setup-pci.c | 3 +++
linux-2.6.3-rc3-root/include/linux/ide.h | 3 +++
4 files changed, 14 insertions(+), 3 deletions(-)
diff -puN drivers/ide/ide.c~ide_dma_off_fix drivers/ide/ide.c
--- linux-2.6.3-rc3/drivers/ide/ide.c~ide_dma_off_fix 2004-02-17 15:49:14.572521328 +0100
+++ linux-2.6.3-rc3-root/drivers/ide/ide.c 2004-02-17 15:51:12.985519816 +0100
@@ -1320,6 +1320,7 @@ static int set_io_32bit(ide_drive_t *dri

static int set_using_dma (ide_drive_t *drive, int arg)
{
+#ifdef CONFIG_BLK_DEV_IDEDMA
if (!drive->id || !(drive->id->capability & 1))
return -EPERM;
if (HWIF(drive)->ide_dma_check == NULL)
@@ -1332,6 +1333,9 @@ static int set_using_dma (ide_drive_t *d
return -EIO;
}
return 0;
+#else
+ return -EPERM;
+#endif
}

static int set_pio_mode (ide_drive_t *drive, int arg)
diff -puN drivers/ide/ide-iops.c~ide_dma_off_fix drivers/ide/ide-iops.c
--- linux-2.6.3-rc3/drivers/ide/ide-iops.c~ide_dma_off_fix 2004-02-17 15:51:33.898340584 +0100
+++ linux-2.6.3-rc3-root/drivers/ide/ide-iops.c 2004-02-17 15:59:43.264945552 +0100
@@ -1125,16 +1125,17 @@ static ide_startstop_t reset_pollfunc (i
return ide_stopped;
}

-void check_dma_crc (ide_drive_t *drive)
+static void check_dma_crc(ide_drive_t *drive)
{
+#ifdef CONFIG_BLK_DEV_IDEDMA
if (drive->crc_count) {
(void) HWIF(drive)->ide_dma_off_quietly(drive);
ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive));
if (drive->current_speed >= XFER_SW_DMA_0)
(void) HWIF(drive)->ide_dma_on(drive);
- } else {
+ } else
(void)__ide_dma_off(drive);
- }
+#endif
}

void pre_reset (ide_drive_t *drive)
diff -puN drivers/ide/setup-pci.c~ide_dma_off_fix drivers/ide/setup-pci.c
--- linux-2.6.3-rc3/drivers/ide/setup-pci.c~ide_dma_off_fix 2004-02-17 16:08:16.775880024 +0100
+++ linux-2.6.3-rc3-root/drivers/ide/setup-pci.c 2004-02-17 16:09:58.969344256 +0100
@@ -150,6 +150,8 @@ static int ide_setup_pci_baseregs (struc
return 0;
}

+#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+
#ifdef CONFIG_BLK_DEV_IDEDMA_FORCED
/*
* Long lost data from 2.0.34 that is now in 2.0.39
@@ -279,6 +281,7 @@ second_chance_to_dma:
}
return dma_base;
}
+#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */

void ide_setup_pci_noise (struct pci_dev *dev, ide_pci_device_t *d)
{
diff -puN include/linux/ide.h~ide_dma_off_fix include/linux/ide.h
--- linux-2.6.3-rc3/include/linux/ide.h~ide_dma_off_fix 2004-02-17 16:19:28.044831632 +0100
+++ linux-2.6.3-rc3-root/include/linux/ide.h 2004-02-17 16:26:07.364125872 +0100
@@ -1626,6 +1626,9 @@ extern ide_startstop_t __ide_dma_queued_
extern ide_startstop_t __ide_dma_queued_write(ide_drive_t *drive);
extern ide_startstop_t __ide_dma_queued_start(ide_drive_t *drive);
#endif
+
+#else
+static inline int __ide_dma_off(ide_drive_t *drive) { return 0; }
#endif /* CONFIG_BLK_DEV_IDEDMA */

#ifndef CONFIG_BLK_DEV_IDEDMA_PCI
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site