IDE: possible cleanups
PATCH 1/1 IDE: possible cleanups
This patch contains the following possible cleanups:
- make some needlessly global code static
- ide-dma.c: remove the unneeded EXPORT_SYMBOL(__ide_dma_test_irq)
Signed-off-by Adrian Bunk <[email protected]>
---
drivers/ide/ide-dma.c | 15 +++++++-------- drivers/ide/ide-iops.c | 10 ++++++---- drivers/ide/ide-pnp.c | 2 +- drivers/ide/ide.c | 10 +++++----- drivers/ide/legacy/ide-cs.c | 2 +- include/linux/ide.h | 12 ------------ 6 files changed, 20 insertions(+), 31 deletions(-)
drivers/ide/legacy/ide-cs.c renamed from drivers/ide/legacy/ide-cs.c.old +1 -1
@@ -209,7 +209,7 @@#define CS_CHECK (fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -void ide_config (dev_link_t *link) +static void ide_config (dev_link_t *link) {client_handle_t handle = link->handle;ide_info_t *info = link->priv;
include/linux/ide.h renamed from include/linux/ide.h.old +0 -12
@@ -1293,8 +1293,6 @@extern void SELECT_MASK (ide_drive_t *,int );extern void QUIRK_LIST (ide_drive_t *); -extern void ata_input_data (ide_drive_t *,void *,u32 ); -extern void ata_output_data (ide_drive_t *,void *,u32 );extern void atapi_input_bytes (ide_drive_t *,void *,u32 );extern void atapi_output_bytes (ide_drive_t *,void *,u32 );
@@ -1337,14 +1335,6 @@ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive,struct request *rq,sector_t block);/* -* ide_system_bus_speed() returns what we think is the system VESA/PCI -* bus speed (in MHz). This is used for calculating interface PIO timings. -* The default is 40 for known PCI systems, 50 otherwise. -* The "idebus=xx" parameter can be used to override this value. -*/ -extern int ide_system_bus_speed (void ); - -/* * ide_stall_queue() can be used by a drive to give excess bandwidth back * to the hwgroup by sleeping for timeout jiffies. */
@@ -1360,7 +1350,6 @@extern void ide_unpin_hwgroup (ide_drive_t *);extern struct block_device_operations ide_fops[]; -extern ide_proc_entry_t generic_subdriver_entries[];extern int ata_attach (ide_drive_t *);
@@ -1456,7 +1445,6 @@extern int ide_dma_setup (ide_drive_t *);extern void ide_dma_start (ide_drive_t *);extern int __ide_dma_end (ide_drive_t *); -extern int __ide_dma_test_irq (ide_drive_t *);extern int __ide_dma_lostirq (ide_drive_t *);extern int __ide_dma_timeout (ide_drive_t *);#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
drivers/ide/ide.c renamed from drivers/ide/ide.c.old +5 -5
@@ -333,7 +333,7 @@* Returns a guessed speed in MHz. */ -int ide_system_bus_speed (void ) +static int ide_system_bus_speed (void ) {static struct pci_device_id pci_default[] = { {PCI_DEVICE (PCI_ANY_ID ,PCI_ANY_ID ) },
@@ -414,7 +414,7 @@#ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_ide_root; -ide_proc_entry_t generic_subdriver_entries[] = { +static ide_proc_entry_t generic_subdriver_entries[] = { {"capacity" ,S_IFREG |S_IRUGO , proc_ide_read_capacity,NULL }, {NULL ,0 ,NULL ,NULL } };
@@ -1684,7 +1684,7 @@* * Remember to update Documentation/ide.txt if you change something here. */ -int __init ide_setup (char *s) +static int __init ide_setup (char *s) {int i, vals[3 ];ide_hwif_t *hwif;
@@ -2248,7 +2248,7 @@/* * This is gets invoked once during initialization, to set *everything* up */ -int __init ide_init (void ) +static int __init ide_init (void ) {printk (KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n" );devfs_mk_dir ("ide" );
@@ -2295,7 +2295,7 @@ }#ifdef MODULE -char *options =NULL ; +static char *options =NULL ;module_param (options, charp,0 );MODULE_LICENSE ("GPL" );
drivers/ide/ide-pnp.c renamed from drivers/ide/ide-pnp.c.old +1 -1
@@ -21,7 +21,7 @@#include <linux/ide.h> /* Add your devices here :)) */ -struct pnp_device_id idepnp_devices[] = { +static struct pnp_device_id idepnp_devices[] = {/* Generic ESDI/IDE/ATA compatible hard disk controller */ {.id ="PNP0600" , .driver_data =0 }, {.id ="" }
drivers/ide/ide-iops.c renamed from drivers/ide/ide-iops.c.old +6 -4
@@ -30,6 +30,8 @@#include <asm/uaccess.h> #include <asm/io.h> +static void ata_input_data (ide_drive_t *drive,void *buffer,u32 wcount); +static void ata_output_data (ide_drive_t *drive,void *buffer,u32 wcount);/* * Conventional PIO operations for ATA devices */
@@ -240,7 +242,7 @@* of the sector count register location, with interrupts disabled * to ensure that the reads all happen together. */ -void ata_vlb_sync (ide_drive_t *drive,unsigned long port) +static void ata_vlb_sync (ide_drive_t *drive,unsigned long port) { (void )HWIF (drive)->INB (port); (void )HWIF (drive)->INB (port);
@@ -250,7 +252,7 @@/* * This is used for most PIO data transfers *from* the IDE interface */ -void ata_input_data (ide_drive_t *drive,void *buffer,u32 wcount) +static void ata_input_data (ide_drive_t *drive,void *buffer,u32 wcount) {ide_hwif_t *hwif =HWIF (drive);u8 io_32bit = drive->io_32bit;
@@ -272,7 +274,7 @@/* * This is used for most PIO data transfers *to* the IDE interface */ -void ata_output_data (ide_drive_t *drive,void *buffer,u32 wcount) +static void ata_output_data (ide_drive_t *drive,void *buffer,u32 wcount) {ide_hwif_t *hwif =HWIF (drive);u8 io_32bit = drive->io_32bit;
@@ -1127,7 +1129,7 @@ drive->special.b.set_multmode =1 ; } -void pre_reset (ide_drive_t *drive) +static void pre_reset (ide_drive_t *drive) {if (drive->media == ide_disk)ide_disk_pre_reset (drive);
drivers/ide/ide-dma.c renamed from drivers/ide/ide-dma.c.old +7 -8
@@ -631,7 +631,7 @@EXPORT_SYMBOL (__ide_dma_end);/* returns 1 if dma irq issued, 0 otherwise */ -int __ide_dma_test_irq (ide_drive_t *drive) +static int __ide_dma_test_irq (ide_drive_t *drive) {ide_hwif_t *hwif =HWIF (drive);u8 dma_stat = hwif->INB (hwif->dma_status);
@@ -651,7 +651,6 @@ return 0; } -EXPORT_SYMBOL (__ide_dma_test_irq);#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ int __ide_dma_bad_drive (ide_drive_t *drive)
@@ -784,7 +783,7 @@/* * Needed for allowing full modular support of ide-driver */ -int ide_release_dma_engine (ide_hwif_t *hwif) +static int ide_release_dma_engine (ide_hwif_t *hwif) {if (hwif->dmatable_cpu) { pci_free_consistent(hwif->pci_dev,
@@ -796,7 +795,7 @@return 1 ; } -int ide_release_iomio_dma (ide_hwif_t *hwif) +static int ide_release_iomio_dma (ide_hwif_t *hwif) {if ((hwif->dma_extra) && (hwif->channel ==0 ))release_region ((hwif->dma_base +16 ), hwif->dma_extra);
@@ -820,7 +819,7 @@return ide_release_iomio_dma (hwif); } -int ide_allocate_dma_engine (ide_hwif_t *hwif) +static int ide_allocate_dma_engine (ide_hwif_t *hwif) { hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, PRD_ENTRIES * PRD_BYTES,
@@ -837,7 +836,7 @@return 1 ; } -int ide_mapped_mmio_dma (ide_hwif_t *hwif,unsigned long base,unsigned int ports) +static int ide_mapped_mmio_dma (ide_hwif_t *hwif,unsigned long base,unsigned int ports) {printk (KERN_INFO " %s: MMIO-DMA " , hwif->name);
@@ -852,7 +851,7 @@return 0 ; } -int ide_iomio_dma (ide_hwif_t *hwif,unsigned long base,unsigned int ports) +static int ide_iomio_dma (ide_hwif_t *hwif,unsigned long base,unsigned int ports) {printk (KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx" , hwif->name, base, base + ports -1 );
@@ -884,7 +883,7 @@/* * */ -int ide_dma_iobase (ide_hwif_t *hwif,unsigned long base,unsigned int ports) +static int ide_dma_iobase (ide_hwif_t *hwif,unsigned long base,unsigned int ports) {if (hwif->mmio ==2 )return ide_mapped_mmio_dma (hwif, base,ports);
Bartlomiej Zolnierkiewicz
AppliedQuoted 5 lines · Adrian Bunk
This patch contains the following possible cleanups:
- make some needlessly global code static
-ide-dma.c: remove the unneededEXPORT_SYMBOL(__ide_dma_test_irq)Signed-off-by Adrian Bunk <[email protected]>
applied