Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide: make ide_hwif_t.ide_dma_host_on void (v2)

* since ide_hwif_t.ide_dma_host_on is called either when drive->using_dma == 1
or when return value is discarded make it void, also drop "ide_" prefix
* make __ide_dma_host_on() void and drop "__" prefix

v2:
* while at it rename atiixp_ide_dma_host_on() to atiixp_dma_host_on()
and sgiioc4_ide_dma_host_on() to sgiioc4_dma_host_on().
[ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

+28 -38
+4 -4
drivers/ide/arm/icside.c
··· 316 316 drive->using_dma = 0; 317 317 } 318 318 319 - static int icside_dma_host_on(ide_drive_t *drive) 319 + static void icside_dma_host_on(ide_drive_t *drive) 320 320 { 321 - return 0; 322 321 } 323 322 324 323 static int icside_dma_on(ide_drive_t *drive) 325 324 { 326 325 drive->using_dma = 1; 327 - return icside_dma_host_on(drive); 326 + 327 + return 0; 328 328 } 329 329 330 330 static int icside_dma_check(ide_drive_t *drive) ··· 494 494 hwif->ide_dma_check = icside_dma_check; 495 495 hwif->dma_host_off = icside_dma_host_off; 496 496 hwif->dma_off_quietly = icside_dma_off_quietly; 497 - hwif->ide_dma_host_on = icside_dma_host_on; 497 + hwif->dma_host_on = icside_dma_host_on; 498 498 hwif->ide_dma_on = icside_dma_on; 499 499 hwif->dma_setup = icside_dma_setup; 500 500 hwif->dma_exec_cmd = icside_dma_exec_cmd;
+1 -1
drivers/ide/cris/ide-cris.c
··· 818 818 hwif->INB = &cris_ide_inb; 819 819 hwif->INW = &cris_ide_inw; 820 820 hwif->dma_host_off = &cris_dma_off; 821 - hwif->ide_dma_host_on = &cris_dma_on; 821 + hwif->dma_host_on = &cris_dma_on; 822 822 hwif->dma_off_quietly = &cris_dma_off; 823 823 hwif->udma_four = 0; 824 824 hwif->ultra_mask = cris_ultra_mask;
+7 -10
drivers/ide/ide-dma.c
··· 468 468 469 469 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI 470 470 /** 471 - * __ide_dma_host_on - Enable DMA on a host 471 + * ide_dma_host_on - Enable DMA on a host 472 472 * @drive: drive to enable for DMA 473 473 * 474 474 * Enable DMA on an IDE controller following generic bus mastering 475 475 * IDE controller behaviour 476 476 */ 477 - 478 - int __ide_dma_host_on (ide_drive_t *drive) 477 + 478 + void ide_dma_host_on(ide_drive_t *drive) 479 479 { 480 480 if (drive->using_dma) { 481 481 ide_hwif_t *hwif = HWIF(drive); ··· 483 483 u8 dma_stat = hwif->INB(hwif->dma_status); 484 484 485 485 hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status); 486 - return 0; 487 486 } 488 - return 1; 489 487 } 490 488 491 - EXPORT_SYMBOL(__ide_dma_host_on); 489 + EXPORT_SYMBOL(ide_dma_host_on); 492 490 493 491 /** 494 492 * __ide_dma_on - Enable DMA on a device ··· 504 506 drive->using_dma = 1; 505 507 ide_toggle_bounce(drive, 1); 506 508 507 - if (HWIF(drive)->ide_dma_host_on(drive)) 508 - return 1; 509 + drive->hwif->dma_host_on(drive); 509 510 510 511 return 0; 511 512 } ··· 937 940 hwif->dma_host_off = &ide_dma_host_off; 938 941 if (!hwif->ide_dma_on) 939 942 hwif->ide_dma_on = &__ide_dma_on; 940 - if (!hwif->ide_dma_host_on) 941 - hwif->ide_dma_host_on = &__ide_dma_host_on; 943 + if (!hwif->dma_host_on) 944 + hwif->dma_host_on = &ide_dma_host_on; 942 945 if (!hwif->ide_dma_check) 943 946 hwif->ide_dma_check = &__ide_dma_check; 944 947 if (!hwif->dma_setup)
+1 -1
drivers/ide/ide-iops.c
··· 830 830 831 831 #ifdef CONFIG_BLK_DEV_IDEDMA 832 832 if (speed >= XFER_SW_DMA_0) 833 - hwif->ide_dma_host_on(drive); 833 + hwif->dma_host_on(drive); 834 834 else if (hwif->ide_dma_check) /* check if host supports DMA */ 835 835 hwif->dma_off_quietly(drive); 836 836 #endif
+1 -1
drivers/ide/ide.c
··· 509 509 hwif->dma_off_quietly = tmp_hwif->dma_off_quietly; 510 510 hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq; 511 511 hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq; 512 - hwif->ide_dma_host_on = tmp_hwif->ide_dma_host_on; 512 + hwif->dma_host_on = tmp_hwif->dma_host_on; 513 513 hwif->dma_host_off = tmp_hwif->dma_host_off; 514 514 hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq; 515 515 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout;
+4 -4
drivers/ide/mips/au1xxx-ide.c
··· 438 438 return 0; 439 439 } 440 440 441 - static int auide_dma_host_on(ide_drive_t *drive) 441 + static void auide_dma_host_on(ide_drive_t *drive) 442 442 { 443 - return 0; 444 443 } 445 444 446 445 static int auide_dma_on(ide_drive_t *drive) 447 446 { 448 447 drive->using_dma = 1; 449 - return auide_dma_host_on(drive); 448 + 449 + return 0; 450 450 } 451 451 452 452 static void auide_dma_host_off(ide_drive_t *drive) ··· 731 731 hwif->dma_setup = &auide_dma_setup; 732 732 hwif->ide_dma_test_irq = &auide_dma_test_irq; 733 733 hwif->dma_host_off = &auide_dma_host_off; 734 - hwif->ide_dma_host_on = &auide_dma_host_on; 734 + hwif->dma_host_on = &auide_dma_host_on; 735 735 hwif->ide_dma_lostirq = &auide_dma_lostirq; 736 736 hwif->ide_dma_on = &auide_dma_on; 737 737
+3 -3
drivers/ide/pci/atiixp.c
··· 101 101 } 102 102 } 103 103 104 - static int atiixp_ide_dma_host_on(ide_drive_t *drive) 104 + static void atiixp_dma_host_on(ide_drive_t *drive) 105 105 { 106 106 struct pci_dev *dev = drive->hwif->pci_dev; 107 107 unsigned long flags; ··· 118 118 119 119 spin_unlock_irqrestore(&atiixp_lock, flags); 120 120 121 - return __ide_dma_host_on(drive); 121 + ide_dma_host_on(drive); 122 122 } 123 123 124 124 static void atiixp_dma_host_off(ide_drive_t *drive) ··· 305 305 else 306 306 hwif->udma_four = 0; 307 307 308 - hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; 308 + hwif->dma_host_on = &atiixp_dma_host_on; 309 309 hwif->dma_host_off = &atiixp_dma_host_off; 310 310 hwif->ide_dma_check = &atiixp_dma_check; 311 311 if (!noautodma)
+3 -8
drivers/ide/pci/sgiioc4.c
··· 279 279 { 280 280 drive->using_dma = 1; 281 281 282 - return HWIF(drive)->ide_dma_host_on(drive); 282 + return 0; 283 283 } 284 284 285 285 static void sgiioc4_dma_off_quietly(ide_drive_t *drive) ··· 307 307 return sgiioc4_checkirq(HWIF(drive)); 308 308 } 309 309 310 - static int 311 - sgiioc4_ide_dma_host_on(ide_drive_t * drive) 310 + static void sgiioc4_dma_host_on(ide_drive_t * drive) 312 311 { 313 - if (drive->using_dma) 314 - return 0; 315 - 316 - return 1; 317 312 } 318 313 319 314 static void sgiioc4_dma_host_off(ide_drive_t * drive) ··· 605 610 hwif->ide_dma_on = &sgiioc4_ide_dma_on; 606 611 hwif->dma_off_quietly = &sgiioc4_dma_off_quietly; 607 612 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq; 608 - hwif->ide_dma_host_on = &sgiioc4_ide_dma_host_on; 613 + hwif->dma_host_on = &sgiioc4_dma_host_on; 609 614 hwif->dma_host_off = &sgiioc4_dma_host_off; 610 615 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 611 616 hwif->ide_dma_timeout = &__ide_dma_timeout;
+2 -4
drivers/ide/ppc/pmac.c
··· 1983 1983 { 1984 1984 } 1985 1985 1986 - static int 1987 - pmac_ide_dma_host_on (ide_drive_t *drive) 1986 + static int pmac_ide_dma_host_on(ide_drive_t *drive) 1988 1987 { 1989 - return 0; 1990 1988 } 1991 1989 1992 1990 static int ··· 2039 2041 hwif->ide_dma_end = &pmac_ide_dma_end; 2040 2042 hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; 2041 2043 hwif->dma_host_off = &pmac_ide_dma_host_off; 2042 - hwif->ide_dma_host_on = &pmac_ide_dma_host_on; 2044 + hwif->dma_host_on = &pmac_ide_dma_host_on; 2043 2045 hwif->ide_dma_timeout = &__ide_dma_timeout; 2044 2046 hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq; 2045 2047
+2 -2
include/linux/ide.h
··· 738 738 void (*dma_off_quietly)(ide_drive_t *drive); 739 739 int (*ide_dma_test_irq)(ide_drive_t *drive); 740 740 void (*ide_dma_clear_irq)(ide_drive_t *drive); 741 - int (*ide_dma_host_on)(ide_drive_t *drive); 741 + void (*dma_host_on)(ide_drive_t *drive); 742 742 void (*dma_host_off)(ide_drive_t *drive); 743 743 int (*ide_dma_lostirq)(ide_drive_t *drive); 744 744 int (*ide_dma_timeout)(ide_drive_t *drive); ··· 1290 1290 1291 1291 void ide_dma_host_off(ide_drive_t *); 1292 1292 void ide_dma_off_quietly(ide_drive_t *); 1293 - extern int __ide_dma_host_on(ide_drive_t *); 1293 + void ide_dma_host_on(ide_drive_t *); 1294 1294 extern int __ide_dma_on(ide_drive_t *); 1295 1295 extern int __ide_dma_check(ide_drive_t *); 1296 1296 extern int ide_dma_setup(ide_drive_t *);