aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBorislav Petkov <bbpetkov@yahoo.de>2008-02-02 13:56:34 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:34 -0500
commitbcc77d9cc12f5fd3e54ea01a6ef8f09e4d7b54a8 (patch)
treeddcffd7ebfb3b138a5e6fbd07524a3a36661740a /drivers
parent7e8b163b253499c6c82f921f8cb5b85e9431518c (diff)
ide-floppy: cleanup and unify debugging macro calls
* some debug_log() calls were not using "ide-floppy: " prefix * a few used printk levels different than KERN_INFO (KERN_NOTICE and KERN_ERR, which is the default one if no level is given) Bart: - fix build issues for IDEFLOPPY_DEBUG_LOG set to 1 while at it - s/__FUNCTION__/__func__/ Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-floppy.c68
1 files changed, 31 insertions, 37 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 51b36b8dd964..2860398b193c 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -58,7 +58,8 @@
58#define IDEFLOPPY_DEBUG( fmt, args... ) 58#define IDEFLOPPY_DEBUG( fmt, args... )
59 59
60#if IDEFLOPPY_DEBUG_LOG 60#if IDEFLOPPY_DEBUG_LOG
61#define debug_log printk 61#define debug_log(fmt, args...) \
62 printk(KERN_INFO "ide-floppy: " fmt, ## args)
62#else 63#else
63#define debug_log(fmt, args... ) do {} while(0) 64#define debug_log(fmt, args... ) do {} while(0)
64#endif 65#endif
@@ -478,7 +479,7 @@ static int idefloppy_do_end_request(ide_drive_t *drive, int uptodate, int nsecs)
478 struct request *rq = HWGROUP(drive)->rq; 479 struct request *rq = HWGROUP(drive)->rq;
479 int error; 480 int error;
480 481
481 debug_log(KERN_INFO "Reached idefloppy_end_request\n"); 482 debug_log("Reached %s\n", __func__);
482 483
483 switch (uptodate) { 484 switch (uptodate) {
484 case 0: error = IDEFLOPPY_ERROR_GENERAL; break; 485 case 0: error = IDEFLOPPY_ERROR_GENERAL; break;
@@ -624,21 +625,20 @@ static void idefloppy_analyze_error (ide_drive_t *drive,idefloppy_request_sense_
624 floppy->progress_indication = result->sksv[0] & 0x80 ? 625 floppy->progress_indication = result->sksv[0] & 0x80 ?
625 (u16)get_unaligned((u16 *)(result->sksv+1)):0x10000; 626 (u16)get_unaligned((u16 *)(result->sksv+1)):0x10000;
626 if (floppy->failed_pc) 627 if (floppy->failed_pc)
627 debug_log(KERN_INFO "ide-floppy: pc = %x, sense key = %x, " 628 debug_log("pc = %x, sense key = %x, asc = %x, ascq = %x\n",
628 "asc = %x, ascq = %x\n", floppy->failed_pc->c[0], 629 floppy->failed_pc->c[0], result->sense_key,
629 result->sense_key, result->asc, result->ascq); 630 result->asc, result->ascq);
630 else 631 else
631 debug_log(KERN_INFO "ide-floppy: sense key = %x, asc = %x, " 632 debug_log("sense key = %x, asc = %x, ascq = %x\n",
632 "ascq = %x\n", result->sense_key, 633 result->sense_key, result->asc, result->ascq);
633 result->asc, result->ascq);
634} 634}
635 635
636static void idefloppy_request_sense_callback (ide_drive_t *drive) 636static void idefloppy_request_sense_callback (ide_drive_t *drive)
637{ 637{
638 idefloppy_floppy_t *floppy = drive->driver_data; 638 idefloppy_floppy_t *floppy = drive->driver_data;
639 639
640 debug_log(KERN_INFO "ide-floppy: Reached %s\n", __FUNCTION__); 640 debug_log("Reached %s\n", __func__);
641 641
642 if (!floppy->pc->error) { 642 if (!floppy->pc->error) {
643 idefloppy_analyze_error(drive,(idefloppy_request_sense_result_t *) floppy->pc->buffer); 643 idefloppy_analyze_error(drive,(idefloppy_request_sense_result_t *) floppy->pc->buffer);
644 idefloppy_do_end_request(drive, 1, 0); 644 idefloppy_do_end_request(drive, 1, 0);
@@ -654,8 +654,8 @@ static void idefloppy_request_sense_callback (ide_drive_t *drive)
654static void idefloppy_pc_callback (ide_drive_t *drive) 654static void idefloppy_pc_callback (ide_drive_t *drive)
655{ 655{
656 idefloppy_floppy_t *floppy = drive->driver_data; 656 idefloppy_floppy_t *floppy = drive->driver_data;
657 657
658 debug_log(KERN_INFO "ide-floppy: Reached %s\n", __FUNCTION__); 658 debug_log("Reached %s\n", __func__);
659 659
660 idefloppy_do_end_request(drive, floppy->pc->error ? 0 : 1, 0); 660 idefloppy_do_end_request(drive, floppy->pc->error ? 0 : 1, 0);
661} 661}
@@ -714,8 +714,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
714 u16 bcount; 714 u16 bcount;
715 u8 stat, ireason; 715 u8 stat, ireason;
716 716
717 debug_log(KERN_INFO "ide-floppy: Reached %s interrupt handler\n", 717 debug_log("Reached %s interrupt handler\n", __func__);
718 __FUNCTION__);
719 718
720 if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { 719 if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) {
721 if (HWIF(drive)->ide_dma_end(drive)) { 720 if (HWIF(drive)->ide_dma_end(drive)) {
@@ -724,23 +723,22 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
724 pc->actually_transferred = pc->request_transfer; 723 pc->actually_transferred = pc->request_transfer;
725 idefloppy_update_buffers(drive, pc); 724 idefloppy_update_buffers(drive, pc);
726 } 725 }
727 debug_log(KERN_INFO "ide-floppy: DMA finished\n"); 726 debug_log("DMA finished\n");
728 } 727 }
729 728
730 /* Clear the interrupt */ 729 /* Clear the interrupt */
731 stat = drive->hwif->INB(IDE_STATUS_REG); 730 stat = drive->hwif->INB(IDE_STATUS_REG);
732 731
733 if ((stat & DRQ_STAT) == 0) { /* No more interrupts */ 732 if ((stat & DRQ_STAT) == 0) { /* No more interrupts */
734 debug_log(KERN_INFO "Packet command completed, %d bytes " 733 debug_log("Packet command completed, %d bytes transferred\n",
735 "transferred\n", pc->actually_transferred); 734 pc->actually_transferred);
736 clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); 735 clear_bit(PC_DMA_IN_PROGRESS, &pc->flags);
737 736
738 local_irq_enable_in_hardirq(); 737 local_irq_enable_in_hardirq();
739 738
740 if ((stat & ERR_STAT) || test_bit(PC_DMA_ERROR, &pc->flags)) { 739 if ((stat & ERR_STAT) || test_bit(PC_DMA_ERROR, &pc->flags)) {
741 /* Error detected */ 740 /* Error detected */
742 debug_log(KERN_INFO "ide-floppy: %s: I/O error\n", 741 debug_log("%s: I/O error\n", drive->name);
743 drive->name);
744 rq->errors++; 742 rq->errors++;
745 if (pc->c[0] == GPCMD_REQUEST_SENSE) { 743 if (pc->c[0] == GPCMD_REQUEST_SENSE) {
746 printk(KERN_ERR "ide-floppy: I/O error in " 744 printk(KERN_ERR "ide-floppy: I/O error in "
@@ -801,9 +799,8 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
801 NULL); 799 NULL);
802 return ide_started; 800 return ide_started;
803 } 801 }
804 debug_log(KERN_NOTICE "ide-floppy: The floppy wants to " 802 debug_log("The floppy wants to send us more data than"
805 "send us more data than expected - " 803 " expected - allowing transfer\n");
806 "allowing transfer\n");
807 } 804 }
808 } 805 }
809 if (test_bit(PC_WRITING, &pc->flags)) { 806 if (test_bit(PC_WRITING, &pc->flags)) {
@@ -970,7 +967,7 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
970 return ide_stopped; 967 return ide_stopped;
971 } 968 }
972 969
973 debug_log(KERN_INFO "Retry number - %d\n",pc->retries); 970 debug_log("Retry number - %d\n", pc->retries);
974 971
975 pc->retries++; 972 pc->retries++;
976 /* We haven't transferred any data yet */ 973 /* We haven't transferred any data yet */
@@ -1019,7 +1016,7 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
1019 1016
1020static void idefloppy_rw_callback (ide_drive_t *drive) 1017static void idefloppy_rw_callback (ide_drive_t *drive)
1021{ 1018{
1022 debug_log(KERN_INFO "ide-floppy: Reached idefloppy_rw_callback\n"); 1019 debug_log("Reached %s\n", __func__);
1023 1020
1024 idefloppy_do_end_request(drive, 1, 0); 1021 idefloppy_do_end_request(drive, 1, 0);
1025 return; 1022 return;
@@ -1027,8 +1024,7 @@ static void idefloppy_rw_callback (ide_drive_t *drive)
1027 1024
1028static void idefloppy_create_prevent_cmd (idefloppy_pc_t *pc, int prevent) 1025static void idefloppy_create_prevent_cmd (idefloppy_pc_t *pc, int prevent)
1029{ 1026{
1030 debug_log(KERN_INFO "ide-floppy: creating prevent removal command, " 1027 debug_log("creating prevent removal command, prevent = %d\n", prevent);
1031 "prevent = %d\n", prevent);
1032 1028
1033 idefloppy_init_pc(pc); 1029 idefloppy_init_pc(pc);
1034 pc->c[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL; 1030 pc->c[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL;
@@ -1164,10 +1160,10 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request
1164 idefloppy_pc_t *pc; 1160 idefloppy_pc_t *pc;
1165 unsigned long block = (unsigned long)block_s; 1161 unsigned long block = (unsigned long)block_s;
1166 1162
1167 debug_log(KERN_INFO "dev: %s, flags: %lx, errors: %d\n", 1163 debug_log("dev: %s, cmd_type: %x, errors: %d\n",
1168 rq->rq_disk ? rq->rq_disk->disk_name : "?", 1164 rq->rq_disk ? rq->rq_disk->disk_name : "?",
1169 rq->flags, rq->errors); 1165 rq->cmd_type, rq->errors);
1170 debug_log(KERN_INFO "sector: %ld, nr_sectors: %ld, " 1166 debug_log("sector: %ld, nr_sectors: %ld, "
1171 "current_nr_sectors: %d\n", (long)rq->sector, 1167 "current_nr_sectors: %d\n", (long)rq->sector,
1172 rq->nr_sectors, rq->current_nr_sectors); 1168 rq->nr_sectors, rq->current_nr_sectors);
1173 1169
@@ -1376,12 +1372,10 @@ static int idefloppy_get_capacity (ide_drive_t *drive)
1376 } 1372 }
1377 } 1373 }
1378 if (!i) { 1374 if (!i) {
1379 debug_log( "Descriptor 0 Code: %d\n", 1375 debug_log("Descriptor 0 Code: %d\n", descriptor->dc);
1380 descriptor->dc);
1381 } 1376 }
1382 debug_log( "Descriptor %d: %dkB, %d blocks, %d " 1377 debug_log("Descriptor %d: %dkB, %d blocks, %d sector size\n",
1383 "sector size\n", i, blocks * length / 1024, blocks, 1378 i, blocks * length / 1024, blocks, length);
1384 length);
1385 } 1379 }
1386 1380
1387 /* Clik! disk does not support get_flexible_disk_page */ 1381 /* Clik! disk does not support get_flexible_disk_page */
@@ -1773,7 +1767,7 @@ static int idefloppy_open(struct inode *inode, struct file *filp)
1773 idefloppy_pc_t pc; 1767 idefloppy_pc_t pc;
1774 int ret = 0; 1768 int ret = 0;
1775 1769
1776 debug_log(KERN_INFO "Reached idefloppy_open\n"); 1770 debug_log("Reached %s\n", __func__);
1777 1771
1778 if (!(floppy = ide_floppy_get(disk))) 1772 if (!(floppy = ide_floppy_get(disk)))
1779 return -ENXIO; 1773 return -ENXIO;
@@ -1833,8 +1827,8 @@ static int idefloppy_release(struct inode *inode, struct file *filp)
1833 struct ide_floppy_obj *floppy = ide_floppy_g(disk); 1827 struct ide_floppy_obj *floppy = ide_floppy_g(disk);
1834 ide_drive_t *drive = floppy->drive; 1828 ide_drive_t *drive = floppy->drive;
1835 idefloppy_pc_t pc; 1829 idefloppy_pc_t pc;
1836 1830
1837 debug_log(KERN_INFO "Reached idefloppy_release\n"); 1831 debug_log("Reached %s\n", __func__);
1838 1832
1839 if (floppy->openers == 1) { 1833 if (floppy->openers == 1) {
1840 /* IOMEGA Clik! drives do not support lock/unlock commands */ 1834 /* IOMEGA Clik! drives do not support lock/unlock commands */