Skip to content

Commit aa5d2de

Browse files
committed
ide: make ide_pc_intr() static
* Always use ide_pc_intr as a handler in ide_pc_intr(). * Remove no longer used ide*_pc_intr() and 'handler' argument from ide_{transfer_pc,pc_intr}(). * Make ide_pc_intr() static. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1 parent 85e3903 commit aa5d2de

5 files changed

Lines changed: 16 additions & 42 deletions

File tree

‎drivers/ide/ide-atapi.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ int ide_scsi_expiry(ide_drive_t *drive)
246246
}
247247
EXPORT_SYMBOL_GPL(ide_scsi_expiry);
248248

249-
ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler)
249+
/*
250+
* This is the usual interrupt handler which will be called during a packet
251+
* command. We will transfer some of the data (as requested by the drive)
252+
* and will re-point interrupt handler to us.
253+
*/
254+
static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
250255
{
251256
struct ide_atapi_pc *pc = drive->pc;
252257
ide_hwif_t *hwif = drive->hwif;
@@ -425,10 +430,9 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler)
425430
rq->cmd[0], bcount);
426431
next_irq:
427432
/* And set the interrupt handler again */
428-
ide_set_handler(drive, handler, timeout, expiry);
433+
ide_set_handler(drive, ide_pc_intr, timeout, expiry);
429434
return ide_started;
430435
}
431-
EXPORT_SYMBOL_GPL(ide_pc_intr);
432436

433437
static u8 ide_read_ireason(ide_drive_t *drive)
434438
{
@@ -464,8 +468,7 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
464468
return ireason;
465469
}
466470

467-
ide_startstop_t ide_transfer_pc(ide_drive_t *drive,
468-
ide_handler_t *handler, unsigned int timeout,
471+
ide_startstop_t ide_transfer_pc(ide_drive_t *drive, unsigned int timeout,
469472
ide_expiry_t *expiry)
470473
{
471474
struct ide_atapi_pc *pc = drive->pc;
@@ -491,7 +494,7 @@ ide_startstop_t ide_transfer_pc(ide_drive_t *drive,
491494
}
492495

493496
/* Set the interrupt routine */
494-
ide_set_handler(drive, handler, timeout, expiry);
497+
ide_set_handler(drive, ide_pc_intr, timeout, expiry);
495498

496499
/* Begin DMA, if necessary */
497500
if (pc->flags & PC_FLAG_DMA_OK) {

‎drivers/ide/ide-floppy.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,6 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc)
193193
idefloppy_end_request(drive, uptodate, 0);
194194
}
195195

196-
/* The usual interrupt handler called during a packet command. */
197-
static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
198-
{
199-
return ide_pc_intr(drive, idefloppy_pc_intr);
200-
}
201-
202196
/*
203197
* What we have here is a classic case of a top half / bottom half interrupt
204198
* service routine. In interrupt mode, the device sends an interrupt to signal
@@ -230,7 +224,7 @@ static ide_startstop_t idefloppy_start_pc_transfer(ide_drive_t *drive)
230224
* where the Busy flag was apparently being deasserted before the
231225
* unit was ready to receive data. This was happening on a
232226
* 1200 MHz Athlon system. 10/26/01 25msec is too short,
233-
* 40 and 50msec work well. idefloppy_pc_intr will not be actually
227+
* 40 and 50msec work well. ide_pc_intr will not be actually
234228
* used until after the packet is moved in about 50 msec.
235229
*/
236230
if (drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) {
@@ -241,7 +235,7 @@ static ide_startstop_t idefloppy_start_pc_transfer(ide_drive_t *drive)
241235
expiry = NULL;
242236
}
243237

244-
return ide_transfer_pc(drive, idefloppy_pc_intr, timeout, expiry);
238+
return ide_transfer_pc(drive, timeout, expiry);
245239
}
246240

247241
static void ide_floppy_report_error(idefloppy_floppy_t *floppy,

‎drivers/ide/ide-tape.c‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -618,18 +618,6 @@ static int ide_tape_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
618618
return bcount;
619619
}
620620

621-
/*
622-
* This is the usual interrupt handler which will be called during a packet
623-
* command. We will transfer some of the data (as requested by the drive) and
624-
* will re-point interrupt handler to us. When data transfer is finished, we
625-
* will act according to the algorithm described before
626-
* idetape_issue_pc.
627-
*/
628-
static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
629-
{
630-
return ide_pc_intr(drive, idetape_pc_intr);
631-
}
632-
633621
/*
634622
* Packet Command Interface
635623
*
@@ -640,9 +628,9 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
640628
* The handling will be done in three stages:
641629
*
642630
* 1. idetape_issue_pc will send the packet command to the drive, and will set
643-
* the interrupt handler to idetape_pc_intr.
631+
* the interrupt handler to ide_pc_intr.
644632
*
645-
* 2. On each interrupt, idetape_pc_intr will be called. This step will be
633+
* 2. On each interrupt, ide_pc_intr will be called. This step will be
646634
* repeated until the device signals us that no more interrupts will be issued.
647635
*
648636
* 3. ATAPI Tape media access commands have immediate status with a delayed
@@ -668,7 +656,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
668656
*/
669657
static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
670658
{
671-
return ide_transfer_pc(drive, idetape_pc_intr, WAIT_TAPE_CMD, NULL);
659+
return ide_transfer_pc(drive, WAIT_TAPE_CMD, NULL);
672660
}
673661

674662
static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,

‎drivers/scsi/ide-scsi.c‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,9 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
270270
return 0;
271271
}
272272

273-
/*
274-
* Our interrupt handler.
275-
*/
276-
static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
277-
{
278-
return ide_pc_intr(drive, idescsi_pc_intr);
279-
}
280-
281273
static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
282274
{
283-
return ide_transfer_pc(drive, idescsi_pc_intr,
284-
ide_scsi_get_timeout(drive->pc),
275+
return ide_transfer_pc(drive, ide_scsi_get_timeout(drive->pc),
285276
ide_scsi_expiry);
286277
}
287278

‎include/linux/ide.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,9 +1188,7 @@ static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc)
11881188

11891189
int ide_scsi_expiry(ide_drive_t *);
11901190

1191-
ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler);
1192-
ide_startstop_t ide_transfer_pc(ide_drive_t *,
1193-
ide_handler_t *, unsigned int, ide_expiry_t *);
1191+
ide_startstop_t ide_transfer_pc(ide_drive_t *, unsigned int, ide_expiry_t *);
11941192
ide_startstop_t ide_issue_pc(ide_drive_t *,
11951193
ide_handler_t *, unsigned int, ide_expiry_t *);
11961194

0 commit comments

Comments
 (0)