diff options
author | Borislav Petkov <bbpetkov@yahoo.de> | 2008-02-02 13:56:35 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 13:56:35 -0500 |
commit | d652c1380870228dfe05a2f00ce4edec3f5bd42d (patch) | |
tree | 7a95b58191d0e75a1f73732f2f644659f76a71ae /drivers/ide/ide-floppy.c | |
parent | d30a7fba4380901b6a33fd798a0d0f9794a70ccc (diff) |
ide-floppy: mv idefloppy_{should_,}report_error
In addition to shortening the function name, move the printk-call into the
function thereby saving some code lines. Also, make the function out_of_line
since it is not on a performance critical path. Finally, rename the reworked
function to ide_floppy..().
Bart:
- minor CodingStyle fixup
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 5c32d0cda4ac..416719c1718b 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -737,18 +737,20 @@ static ide_startstop_t idefloppy_transfer_pc1 (ide_drive_t *drive) | |||
737 | return ide_started; | 737 | return ide_started; |
738 | } | 738 | } |
739 | 739 | ||
740 | /** | 740 | static void ide_floppy_report_error(idefloppy_floppy_t *floppy, |
741 | * idefloppy_should_report_error() | 741 | idefloppy_pc_t *pc) |
742 | * | ||
743 | * Supresses error messages resulting from Medium not present | ||
744 | */ | ||
745 | static inline int idefloppy_should_report_error(idefloppy_floppy_t *floppy) | ||
746 | { | 742 | { |
743 | /* supress error messages resulting from Medium not present */ | ||
747 | if (floppy->sense_key == 0x02 && | 744 | if (floppy->sense_key == 0x02 && |
748 | floppy->asc == 0x3a && | 745 | floppy->asc == 0x3a && |
749 | floppy->ascq == 0x00) | 746 | floppy->ascq == 0x00) |
750 | return 0; | 747 | return; |
751 | return 1; | 748 | |
749 | printk(KERN_ERR "ide-floppy: %s: I/O error, pc = %2x, key = %2x, " | ||
750 | "asc = %2x, ascq = %2x\n", | ||
751 | floppy->drive->name, pc->c[0], floppy->sense_key, | ||
752 | floppy->asc, floppy->ascq); | ||
753 | |||
752 | } | 754 | } |
753 | 755 | ||
754 | /* | 756 | /* |
@@ -775,15 +777,8 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p | |||
775 | * a legitimate error code was received. | 777 | * a legitimate error code was received. |
776 | */ | 778 | */ |
777 | if (!test_bit(PC_ABORT, &pc->flags)) { | 779 | if (!test_bit(PC_ABORT, &pc->flags)) { |
778 | if (!test_bit(PC_SUPPRESS_ERROR, &pc->flags)) { | 780 | if (!test_bit(PC_SUPPRESS_ERROR, &pc->flags)) |
779 | if (idefloppy_should_report_error(floppy)) | 781 | ide_floppy_report_error(floppy, pc); |
780 | printk(KERN_ERR "ide-floppy: %s: I/O error, " | ||
781 | "pc = %2x, key = %2x, " | ||
782 | "asc = %2x, ascq = %2x\n", | ||
783 | drive->name, pc->c[0], | ||
784 | floppy->sense_key, | ||
785 | floppy->asc, floppy->ascq); | ||
786 | } | ||
787 | /* Giving up */ | 782 | /* Giving up */ |
788 | pc->error = IDEFLOPPY_ERROR_GENERAL; | 783 | pc->error = IDEFLOPPY_ERROR_GENERAL; |
789 | } | 784 | } |
@@ -993,13 +988,8 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request | |||
993 | rq->nr_sectors, rq->current_nr_sectors); | 988 | rq->nr_sectors, rq->current_nr_sectors); |
994 | 989 | ||
995 | if (rq->errors >= ERROR_MAX) { | 990 | if (rq->errors >= ERROR_MAX) { |
996 | if (floppy->failed_pc != NULL) { | 991 | if (floppy->failed_pc) |
997 | if (idefloppy_should_report_error(floppy)) | 992 | ide_floppy_report_error(floppy, floppy->failed_pc); |
998 | printk(KERN_ERR "ide-floppy: %s: I/O error, pc = %2x," | ||
999 | " key = %2x, asc = %2x, ascq = %2x\n", | ||
1000 | drive->name, floppy->failed_pc->c[0], | ||
1001 | floppy->sense_key, floppy->asc, floppy->ascq); | ||
1002 | } | ||
1003 | else | 993 | else |
1004 | printk(KERN_ERR "ide-floppy: %s: I/O error\n", | 994 | printk(KERN_ERR "ide-floppy: %s: I/O error\n", |
1005 | drive->name); | 995 | drive->name); |