diff options
author | Borislav Petkov <petkovbb@gmail.com> | 2009-01-02 07:34:47 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:19 -0400 |
commit | 088b1b88609ce89b6ab19d114cdbec94a44aa22c (patch) | |
tree | 2c4f7769e8b2854bcb028dda99c34fe7de3847ae | |
parent | 70775e9c627d7094189b96d73fffced6dab30b30 (diff) |
ide: improve debugging scheme
and more specifically, push __func__ into debug
macro thus making ide_debug_log() calls shorter and more readable.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
-rw-r--r-- | drivers/ide/ide-cd.c | 124 | ||||
-rw-r--r-- | drivers/ide/ide-cd.h | 2 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 35 | ||||
-rw-r--r-- | drivers/ide/ide-gd.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-gd.h | 2 | ||||
-rw-r--r-- | include/linux/ide.h | 9 |
6 files changed, 83 insertions, 93 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 2177cd11664c..d163e6571e09 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -100,8 +100,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, | |||
100 | { | 100 | { |
101 | int log = 0; | 101 | int log = 0; |
102 | 102 | ||
103 | ide_debug_log(IDE_DBG_SENSE, "Call %s, sense_key: 0x%x\n", __func__, | 103 | ide_debug_log(IDE_DBG_SENSE, "sense_key: 0x%x", sense->sense_key); |
104 | sense->sense_key); | ||
105 | 104 | ||
106 | if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) | 105 | if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) |
107 | return 0; | 106 | return 0; |
@@ -151,13 +150,12 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, | |||
151 | unsigned long bio_sectors; | 150 | unsigned long bio_sectors; |
152 | struct cdrom_info *info = drive->driver_data; | 151 | struct cdrom_info *info = drive->driver_data; |
153 | 152 | ||
154 | ide_debug_log(IDE_DBG_SENSE, "Call %s, error_code: 0x%x, " | 153 | ide_debug_log(IDE_DBG_SENSE, "error_code: 0x%x, sense_key: 0x%x", |
155 | "sense_key: 0x%x\n", __func__, sense->error_code, | 154 | sense->error_code, sense->sense_key); |
156 | sense->sense_key); | ||
157 | 155 | ||
158 | if (failed_command) | 156 | if (failed_command) |
159 | ide_debug_log(IDE_DBG_SENSE, "%s: failed cmd: 0x%x\n", | 157 | ide_debug_log(IDE_DBG_SENSE, "failed cmd: 0x%x", |
160 | __func__, failed_command->cmd[0]); | 158 | failed_command->cmd[0]); |
161 | 159 | ||
162 | if (!cdrom_log_sense(drive, failed_command, sense)) | 160 | if (!cdrom_log_sense(drive, failed_command, sense)) |
163 | return; | 161 | return; |
@@ -217,7 +215,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, | |||
217 | struct cdrom_info *info = drive->driver_data; | 215 | struct cdrom_info *info = drive->driver_data; |
218 | struct request *rq = &info->request_sense_request; | 216 | struct request *rq = &info->request_sense_request; |
219 | 217 | ||
220 | ide_debug_log(IDE_DBG_SENSE, "Call %s\n", __func__); | 218 | ide_debug_log(IDE_DBG_SENSE, "enter"); |
221 | 219 | ||
222 | if (sense == NULL) | 220 | if (sense == NULL) |
223 | sense = &info->sense_data; | 221 | sense = &info->sense_data; |
@@ -239,8 +237,8 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, | |||
239 | rq->buffer = (void *) failed_command; | 237 | rq->buffer = (void *) failed_command; |
240 | 238 | ||
241 | if (failed_command) | 239 | if (failed_command) |
242 | ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n", | 240 | ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x", |
243 | failed_command->cmd[0]); | 241 | failed_command->cmd[0]); |
244 | 242 | ||
245 | drive->hwif->rq = NULL; | 243 | drive->hwif->rq = NULL; |
246 | 244 | ||
@@ -252,9 +250,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) | |||
252 | struct request *rq = drive->hwif->rq; | 250 | struct request *rq = drive->hwif->rq; |
253 | int nsectors = rq->hard_cur_sectors; | 251 | int nsectors = rq->hard_cur_sectors; |
254 | 252 | ||
255 | ide_debug_log(IDE_DBG_FUNC, "Call %s, cmd: 0x%x, uptodate: 0x%x, " | 253 | ide_debug_log(IDE_DBG_FUNC, "cmd: 0x%x, uptodate: 0x%x, nsectors: %d", |
256 | "nsectors: %d\n", __func__, rq->cmd[0], uptodate, | 254 | rq->cmd[0], uptodate, nsectors); |
257 | nsectors); | ||
258 | 255 | ||
259 | if (blk_sense_request(rq) && uptodate) { | 256 | if (blk_sense_request(rq) && uptodate) { |
260 | /* | 257 | /* |
@@ -295,8 +292,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) | |||
295 | if (!nsectors) | 292 | if (!nsectors) |
296 | nsectors = 1; | 293 | nsectors = 1; |
297 | 294 | ||
298 | ide_debug_log(IDE_DBG_FUNC, "Exit %s, uptodate: 0x%x, nsectors: %d\n", | 295 | ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d", |
299 | __func__, uptodate, nsectors); | 296 | uptodate, nsectors); |
300 | 297 | ||
301 | ide_end_request(drive, uptodate, nsectors); | 298 | ide_end_request(drive, uptodate, nsectors); |
302 | } | 299 | } |
@@ -338,9 +335,10 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
338 | return 1; | 335 | return 1; |
339 | } | 336 | } |
340 | 337 | ||
341 | ide_debug_log(IDE_DBG_RQ, "%s: stat: 0x%x, good_stat: 0x%x, " | 338 | ide_debug_log(IDE_DBG_RQ, "stat: 0x%x, good_stat: 0x%x, cmd[0]: 0x%x, " |
342 | "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x, err: 0x%x\n", | 339 | "rq->cmd_type: 0x%x, err: 0x%x", |
343 | __func__, stat, good_stat, rq->cmd[0], rq->cmd_type, err); | 340 | stat, good_stat, rq->cmd[0], rq->cmd_type, |
341 | err); | ||
344 | 342 | ||
345 | if (blk_sense_request(rq)) { | 343 | if (blk_sense_request(rq)) { |
346 | /* | 344 | /* |
@@ -530,8 +528,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
530 | { | 528 | { |
531 | ide_hwif_t *hwif = drive->hwif; | 529 | ide_hwif_t *hwif = drive->hwif; |
532 | 530 | ||
533 | ide_debug_log(IDE_DBG_FUNC, "Call %s, ireason: 0x%x, rw: 0x%x\n", | 531 | ide_debug_log(IDE_DBG_FUNC, "ireason: 0x%x, rw: 0x%x", ireason, rw); |
534 | __func__, ireason, rw); | ||
535 | 532 | ||
536 | /* | 533 | /* |
537 | * ireason == 0: the drive wants to receive data from us | 534 | * ireason == 0: the drive wants to receive data from us |
@@ -572,7 +569,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
572 | */ | 569 | */ |
573 | static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) | 570 | static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) |
574 | { | 571 | { |
575 | ide_debug_log(IDE_DBG_FUNC, "Call %s, len: %d\n", __func__, len); | 572 | ide_debug_log(IDE_DBG_FUNC, "len: %d", len); |
576 | 573 | ||
577 | if ((len % SECTOR_SIZE) == 0) | 574 | if ((len % SECTOR_SIZE) == 0) |
578 | return 0; | 575 | return 0; |
@@ -594,8 +591,7 @@ static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) | |||
594 | static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, | 591 | static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, |
595 | struct request *rq) | 592 | struct request *rq) |
596 | { | 593 | { |
597 | ide_debug_log(IDE_DBG_RQ, "Call %s: rq->cmd_flags: 0x%x\n", __func__, | 594 | ide_debug_log(IDE_DBG_RQ, "rq->cmd_flags: 0x%x", rq->cmd_flags); |
598 | rq->cmd_flags); | ||
599 | 595 | ||
600 | if (rq_data_dir(rq) == READ) { | 596 | if (rq_data_dir(rq) == READ) { |
601 | unsigned short sectors_per_frame = | 597 | unsigned short sectors_per_frame = |
@@ -639,7 +635,7 @@ static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, | |||
639 | static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) | 635 | static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) |
640 | { | 636 | { |
641 | 637 | ||
642 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 638 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
643 | 639 | ||
644 | if (rq->buffer != bio_data(rq->bio)) { | 640 | if (rq->buffer != bio_data(rq->bio)) { |
645 | sector_t n = | 641 | sector_t n = |
@@ -658,8 +654,7 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) | |||
658 | 654 | ||
659 | static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq) | 655 | static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq) |
660 | { | 656 | { |
661 | ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n", | 657 | ide_debug_log(IDE_DBG_FUNC, "rq->cmd[0]: 0x%x", rq->cmd[0]); |
662 | __func__, rq->cmd[0]); | ||
663 | 658 | ||
664 | /* | 659 | /* |
665 | * Some of the trailing request sense fields are optional, | 660 | * Some of the trailing request sense fields are optional, |
@@ -686,9 +681,9 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd, | |||
686 | if (!sense) | 681 | if (!sense) |
687 | sense = &local_sense; | 682 | sense = &local_sense; |
688 | 683 | ||
689 | ide_debug_log(IDE_DBG_PC, "Call %s, cmd[0]: 0x%x, write: 0x%x, " | 684 | ide_debug_log(IDE_DBG_PC, "cmd[0]: 0x%x, write: 0x%x, timeout: %d, " |
690 | "timeout: %d, cmd_flags: 0x%x\n", __func__, cmd[0], write, | 685 | "cmd_flags: 0x%x", |
691 | timeout, cmd_flags); | 686 | cmd[0], write, timeout, cmd_flags); |
692 | 687 | ||
693 | /* start of retry loop */ | 688 | /* start of retry loop */ |
694 | do { | 689 | do { |
@@ -772,8 +767,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
772 | u16 len; | 767 | u16 len; |
773 | u8 ireason; | 768 | u8 ireason; |
774 | 769 | ||
775 | ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x\n", | 770 | ide_debug_log(IDE_DBG_PC, "cmd[0]: 0x%x, write: 0x%x", |
776 | __func__, rq->cmd[0], write); | 771 | rq->cmd[0], write); |
777 | 772 | ||
778 | /* check for errors */ | 773 | /* check for errors */ |
779 | dma = drive->dma; | 774 | dma = drive->dma; |
@@ -810,8 +805,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
810 | if (thislen > len) | 805 | if (thislen > len) |
811 | thislen = len; | 806 | thislen = len; |
812 | 807 | ||
813 | ide_debug_log(IDE_DBG_PC, "%s: DRQ: stat: 0x%x, thislen: %d\n", | 808 | ide_debug_log(IDE_DBG_PC, "DRQ: stat: 0x%x, thislen: %d", |
814 | __func__, stat, thislen); | 809 | stat, thislen); |
815 | 810 | ||
816 | /* If DRQ is clear, the command has completed. */ | 811 | /* If DRQ is clear, the command has completed. */ |
817 | if ((stat & ATA_DRQ) == 0) { | 812 | if ((stat & ATA_DRQ) == 0) { |
@@ -876,8 +871,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
876 | xferfunc = hwif->tp_ops->input_data; | 871 | xferfunc = hwif->tp_ops->input_data; |
877 | } | 872 | } |
878 | 873 | ||
879 | ide_debug_log(IDE_DBG_PC, "%s: data transfer, rq->cmd_type: 0x%x, " | 874 | ide_debug_log(IDE_DBG_PC, "data transfer, rq->cmd_type: 0x%x, " |
880 | "ireason: 0x%x\n", __func__, rq->cmd_type, ireason); | 875 | "ireason: 0x%x", |
876 | rq->cmd_type, ireason); | ||
881 | 877 | ||
882 | /* transfer data */ | 878 | /* transfer data */ |
883 | while (thislen > 0) { | 879 | while (thislen > 0) { |
@@ -988,9 +984,9 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq) | |||
988 | unsigned short sectors_per_frame = | 984 | unsigned short sectors_per_frame = |
989 | queue_hardsect_size(drive->queue) >> SECTOR_BITS; | 985 | queue_hardsect_size(drive->queue) >> SECTOR_BITS; |
990 | 986 | ||
991 | ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, " | 987 | ide_debug_log(IDE_DBG_RQ, "rq->cmd[0]: 0x%x, write: 0x%x, " |
992 | "secs_per_frame: %u\n", | 988 | "secs_per_frame: %u", |
993 | __func__, rq->cmd[0], write, sectors_per_frame); | 989 | rq->cmd[0], write, sectors_per_frame); |
994 | 990 | ||
995 | if (write) { | 991 | if (write) { |
996 | /* disk has become write protected */ | 992 | /* disk has become write protected */ |
@@ -1026,9 +1022,8 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq) | |||
1026 | static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) | 1022 | static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) |
1027 | { | 1023 | { |
1028 | 1024 | ||
1029 | ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, " | 1025 | ide_debug_log(IDE_DBG_PC, "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x", |
1030 | "rq->cmd_type: 0x%x\n", __func__, rq->cmd[0], | 1026 | rq->cmd[0], rq->cmd_type); |
1031 | rq->cmd_type); | ||
1032 | 1027 | ||
1033 | if (blk_pc_request(rq)) | 1028 | if (blk_pc_request(rq)) |
1034 | rq->cmd_flags |= REQ_QUIET; | 1029 | rq->cmd_flags |= REQ_QUIET; |
@@ -1067,10 +1062,11 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) | |||
1067 | static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | 1062 | static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, |
1068 | sector_t block) | 1063 | sector_t block) |
1069 | { | 1064 | { |
1070 | ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, " | 1065 | ide_debug_log(IDE_DBG_RQ, "cmd: 0x%x, block: %llu", |
1071 | "rq->cmd_type: 0x%x, block: %llu\n", | 1066 | rq->cmd[0], (unsigned long long)block); |
1072 | __func__, rq->cmd[0], rq->cmd_type, | 1067 | |
1073 | (unsigned long long)block); | 1068 | if (drive->debug_mask & IDE_DBG_RQ) |
1069 | blk_dump_rq_flags(rq, "ide_cd_do_request"); | ||
1074 | 1070 | ||
1075 | if (blk_fs_request(rq)) { | 1071 | if (blk_fs_request(rq)) { |
1076 | if (cdrom_start_rw(drive, rq) == ide_stopped) | 1072 | if (cdrom_start_rw(drive, rq) == ide_stopped) |
@@ -1119,7 +1115,7 @@ int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) | |||
1119 | struct cdrom_device_info *cdi = &info->devinfo; | 1115 | struct cdrom_device_info *cdi = &info->devinfo; |
1120 | unsigned char cmd[BLK_MAX_CDB]; | 1116 | unsigned char cmd[BLK_MAX_CDB]; |
1121 | 1117 | ||
1122 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1118 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1123 | 1119 | ||
1124 | memset(cmd, 0, BLK_MAX_CDB); | 1120 | memset(cmd, 0, BLK_MAX_CDB); |
1125 | cmd[0] = GPCMD_TEST_UNIT_READY; | 1121 | cmd[0] = GPCMD_TEST_UNIT_READY; |
@@ -1147,7 +1143,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
1147 | unsigned len = sizeof(capbuf); | 1143 | unsigned len = sizeof(capbuf); |
1148 | u32 blocklen; | 1144 | u32 blocklen; |
1149 | 1145 | ||
1150 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1146 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1151 | 1147 | ||
1152 | memset(cmd, 0, BLK_MAX_CDB); | 1148 | memset(cmd, 0, BLK_MAX_CDB); |
1153 | cmd[0] = GPCMD_READ_CDVD_CAPACITY; | 1149 | cmd[0] = GPCMD_READ_CDVD_CAPACITY; |
@@ -1179,8 +1175,8 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
1179 | *capacity = 1 + be32_to_cpu(capbuf.lba); | 1175 | *capacity = 1 + be32_to_cpu(capbuf.lba); |
1180 | *sectors_per_frame = blocklen >> SECTOR_BITS; | 1176 | *sectors_per_frame = blocklen >> SECTOR_BITS; |
1181 | 1177 | ||
1182 | ide_debug_log(IDE_DBG_PROBE, "%s: cap: %lu, sectors_per_frame: %lu\n", | 1178 | ide_debug_log(IDE_DBG_PROBE, "cap: %lu, sectors_per_frame: %lu", |
1183 | __func__, *capacity, *sectors_per_frame); | 1179 | *capacity, *sectors_per_frame); |
1184 | 1180 | ||
1185 | return 0; | 1181 | return 0; |
1186 | } | 1182 | } |
@@ -1191,7 +1187,7 @@ static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag, | |||
1191 | { | 1187 | { |
1192 | unsigned char cmd[BLK_MAX_CDB]; | 1188 | unsigned char cmd[BLK_MAX_CDB]; |
1193 | 1189 | ||
1194 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1190 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1195 | 1191 | ||
1196 | memset(cmd, 0, BLK_MAX_CDB); | 1192 | memset(cmd, 0, BLK_MAX_CDB); |
1197 | 1193 | ||
@@ -1221,7 +1217,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1221 | long last_written; | 1217 | long last_written; |
1222 | unsigned long sectors_per_frame = SECTORS_PER_FRAME; | 1218 | unsigned long sectors_per_frame = SECTORS_PER_FRAME; |
1223 | 1219 | ||
1224 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1220 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1225 | 1221 | ||
1226 | if (toc == NULL) { | 1222 | if (toc == NULL) { |
1227 | /* try to allocate space */ | 1223 | /* try to allocate space */ |
@@ -1383,7 +1379,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, u8 *buf) | |||
1383 | struct packet_command cgc; | 1379 | struct packet_command cgc; |
1384 | int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; | 1380 | int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; |
1385 | 1381 | ||
1386 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1382 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1387 | 1383 | ||
1388 | if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0) | 1384 | if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0) |
1389 | size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; | 1385 | size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; |
@@ -1403,7 +1399,7 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) | |||
1403 | struct cdrom_info *cd = drive->driver_data; | 1399 | struct cdrom_info *cd = drive->driver_data; |
1404 | u16 curspeed, maxspeed; | 1400 | u16 curspeed, maxspeed; |
1405 | 1401 | ||
1406 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1402 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1407 | 1403 | ||
1408 | if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) { | 1404 | if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) { |
1409 | curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]); | 1405 | curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]); |
@@ -1413,8 +1409,8 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) | |||
1413 | maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]); | 1409 | maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]); |
1414 | } | 1410 | } |
1415 | 1411 | ||
1416 | ide_debug_log(IDE_DBG_PROBE, "%s: curspeed: %u, maxspeed: %u\n", | 1412 | ide_debug_log(IDE_DBG_PROBE, "curspeed: %u, maxspeed: %u", |
1417 | __func__, curspeed, maxspeed); | 1413 | curspeed, maxspeed); |
1418 | 1414 | ||
1419 | cd->current_speed = (curspeed + (176/2)) / 176; | 1415 | cd->current_speed = (curspeed + (176/2)) / 176; |
1420 | cd->max_speed = (maxspeed + (176/2)) / 176; | 1416 | cd->max_speed = (maxspeed + (176/2)) / 176; |
@@ -1448,7 +1444,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots) | |||
1448 | struct cdrom_info *info = drive->driver_data; | 1444 | struct cdrom_info *info = drive->driver_data; |
1449 | struct cdrom_device_info *devinfo = &info->devinfo; | 1445 | struct cdrom_device_info *devinfo = &info->devinfo; |
1450 | 1446 | ||
1451 | ide_debug_log(IDE_DBG_PROBE, "Call %s, nslots: %d\n", __func__, nslots); | 1447 | ide_debug_log(IDE_DBG_PROBE, "nslots: %d", nslots); |
1452 | 1448 | ||
1453 | devinfo->ops = &ide_cdrom_dops; | 1449 | devinfo->ops = &ide_cdrom_dops; |
1454 | devinfo->speed = info->current_speed; | 1450 | devinfo->speed = info->current_speed; |
@@ -1471,9 +1467,8 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) | |||
1471 | mechtype_t mechtype; | 1467 | mechtype_t mechtype; |
1472 | int nslots = 1; | 1468 | int nslots = 1; |
1473 | 1469 | ||
1474 | ide_debug_log(IDE_DBG_PROBE, "Call %s, drive->media: 0x%x, " | 1470 | ide_debug_log(IDE_DBG_PROBE, "media: 0x%x, atapi_flags: 0x%lx", |
1475 | "drive->atapi_flags: 0x%lx\n", __func__, drive->media, | 1471 | drive->media, drive->atapi_flags); |
1476 | drive->atapi_flags); | ||
1477 | 1472 | ||
1478 | cdi->mask = (CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R | | 1473 | cdi->mask = (CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R | |
1479 | CDC_DVD_RAM | CDC_SELECT_DISC | CDC_PLAY_AUDIO | | 1474 | CDC_DVD_RAM | CDC_SELECT_DISC | CDC_PLAY_AUDIO | |
@@ -1754,7 +1749,7 @@ static int ide_cdrom_setup(ide_drive_t *drive) | |||
1754 | char *fw_rev = (char *)&id[ATA_ID_FW_REV]; | 1749 | char *fw_rev = (char *)&id[ATA_ID_FW_REV]; |
1755 | int nslots; | 1750 | int nslots; |
1756 | 1751 | ||
1757 | ide_debug_log(IDE_DBG_PROBE, "Call %s\n", __func__); | 1752 | ide_debug_log(IDE_DBG_PROBE, "enter"); |
1758 | 1753 | ||
1759 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); | 1754 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); |
1760 | blk_queue_dma_alignment(drive->queue, 31); | 1755 | blk_queue_dma_alignment(drive->queue, 31); |
@@ -1797,7 +1792,7 @@ static void ide_cd_remove(ide_drive_t *drive) | |||
1797 | { | 1792 | { |
1798 | struct cdrom_info *info = drive->driver_data; | 1793 | struct cdrom_info *info = drive->driver_data; |
1799 | 1794 | ||
1800 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1795 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1801 | 1796 | ||
1802 | ide_proc_unregister_driver(drive, info->driver); | 1797 | ide_proc_unregister_driver(drive, info->driver); |
1803 | device_del(&info->dev); | 1798 | device_del(&info->dev); |
@@ -1815,7 +1810,7 @@ static void ide_cd_release(struct device *dev) | |||
1815 | ide_drive_t *drive = info->drive; | 1810 | ide_drive_t *drive = info->drive; |
1816 | struct gendisk *g = info->disk; | 1811 | struct gendisk *g = info->disk; |
1817 | 1812 | ||
1818 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1813 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
1819 | 1814 | ||
1820 | kfree(info->toc); | 1815 | kfree(info->toc); |
1821 | if (devinfo->handle == drive) | 1816 | if (devinfo->handle == drive) |
@@ -1974,9 +1969,8 @@ static int ide_cd_probe(ide_drive_t *drive) | |||
1974 | struct gendisk *g; | 1969 | struct gendisk *g; |
1975 | struct request_sense sense; | 1970 | struct request_sense sense; |
1976 | 1971 | ||
1977 | ide_debug_log(IDE_DBG_PROBE, "Call %s, drive->driver_req: %s, " | 1972 | ide_debug_log(IDE_DBG_PROBE, "driver_req: %s, media: 0x%x", |
1978 | "drive->media: 0x%x\n", __func__, drive->driver_req, | 1973 | drive->driver_req, drive->media); |
1979 | drive->media); | ||
1980 | 1974 | ||
1981 | if (!strstr("ide-cdrom", drive->driver_req)) | 1975 | if (!strstr("ide-cdrom", drive->driver_req)) |
1982 | goto failed; | 1976 | goto failed; |
diff --git a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h index c878bfcf1116..3b77dd735088 100644 --- a/drivers/ide/ide-cd.h +++ b/drivers/ide/ide-cd.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define IDECD_DEBUG_LOG 0 | 11 | #define IDECD_DEBUG_LOG 0 |
12 | 12 | ||
13 | #if IDECD_DEBUG_LOG | 13 | #if IDECD_DEBUG_LOG |
14 | #define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, args) | 14 | #define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, ## args) |
15 | #else | 15 | #else |
16 | #define ide_debug_log(lvl, fmt, args...) do {} while (0) | 16 | #define ide_debug_log(lvl, fmt, args...) do {} while (0) |
17 | #endif | 17 | #endif |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 317ec62c33d4..d1a79e8e0d69 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -74,7 +74,7 @@ static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs) | |||
74 | struct request *rq = drive->hwif->rq; | 74 | struct request *rq = drive->hwif->rq; |
75 | int error; | 75 | int error; |
76 | 76 | ||
77 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 77 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
78 | 78 | ||
79 | switch (uptodate) { | 79 | switch (uptodate) { |
80 | case 0: | 80 | case 0: |
@@ -121,7 +121,7 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) | |||
121 | struct ide_atapi_pc *pc = drive->pc; | 121 | struct ide_atapi_pc *pc = drive->pc; |
122 | int uptodate = pc->error ? 0 : 1; | 122 | int uptodate = pc->error ? 0 : 1; |
123 | 123 | ||
124 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 124 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
125 | 125 | ||
126 | if (floppy->failed_pc == pc) | 126 | if (floppy->failed_pc == pc) |
127 | floppy->failed_pc = NULL; | 127 | floppy->failed_pc = NULL; |
@@ -140,11 +140,11 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) | |||
140 | (u16)get_unaligned((u16 *)&buf[16]) : 0x10000; | 140 | (u16)get_unaligned((u16 *)&buf[16]) : 0x10000; |
141 | 141 | ||
142 | if (floppy->failed_pc) | 142 | if (floppy->failed_pc) |
143 | ide_debug_log(IDE_DBG_PC, "pc = %x, ", | 143 | ide_debug_log(IDE_DBG_PC, "pc = %x", |
144 | floppy->failed_pc->c[0]); | 144 | floppy->failed_pc->c[0]); |
145 | 145 | ||
146 | ide_debug_log(IDE_DBG_SENSE, "sense key = %x, asc = %x," | 146 | ide_debug_log(IDE_DBG_SENSE, "sense key = %x, asc = %x," |
147 | "ascq = %x\n", floppy->sense_key, | 147 | "ascq = %x", floppy->sense_key, |
148 | floppy->asc, floppy->ascq); | 148 | floppy->asc, floppy->ascq); |
149 | } else | 149 | } else |
150 | printk(KERN_ERR PFX "Error in REQUEST SENSE itself - " | 150 | printk(KERN_ERR PFX "Error in REQUEST SENSE itself - " |
@@ -193,7 +193,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, | |||
193 | return ide_stopped; | 193 | return ide_stopped; |
194 | } | 194 | } |
195 | 195 | ||
196 | ide_debug_log(IDE_DBG_FUNC, "%s: Retry #%d\n", __func__, pc->retries); | 196 | ide_debug_log(IDE_DBG_FUNC, "retry #%d", pc->retries); |
197 | 197 | ||
198 | pc->retries++; | 198 | pc->retries++; |
199 | 199 | ||
@@ -242,8 +242,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive, | |||
242 | int blocks = rq->nr_sectors / floppy->bs_factor; | 242 | int blocks = rq->nr_sectors / floppy->bs_factor; |
243 | int cmd = rq_data_dir(rq); | 243 | int cmd = rq_data_dir(rq); |
244 | 244 | ||
245 | ide_debug_log(IDE_DBG_FUNC, "%s: block: %d, blocks: %d\n", __func__, | 245 | ide_debug_log(IDE_DBG_FUNC, "block: %d, blocks: %d", block, blocks); |
246 | block, blocks); | ||
247 | 246 | ||
248 | ide_init_pc(pc); | 247 | ide_init_pc(pc); |
249 | pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10; | 248 | pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10; |
@@ -287,15 +286,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, | |||
287 | ide_hwif_t *hwif = drive->hwif; | 286 | ide_hwif_t *hwif = drive->hwif; |
288 | struct ide_atapi_pc *pc; | 287 | struct ide_atapi_pc *pc; |
289 | 288 | ||
290 | ide_debug_log(IDE_DBG_FUNC, "%s: dev: %s, cmd: 0x%x, cmd_type: %x, " | 289 | if (drive->debug_mask & IDE_DBG_RQ) |
291 | "errors: %d\n", | 290 | blk_dump_rq_flags(rq, (rq->rq_disk |
292 | __func__, rq->rq_disk ? rq->rq_disk->disk_name : "?", | 291 | ? rq->rq_disk->disk_name |
293 | rq->cmd[0], rq->cmd_type, rq->errors); | 292 | : "dev?")); |
294 | |||
295 | ide_debug_log(IDE_DBG_FUNC, "%s: sector: %ld, nr_sectors: %ld, " | ||
296 | "current_nr_sectors: %d\n", | ||
297 | __func__, (long)rq->sector, rq->nr_sectors, | ||
298 | rq->current_nr_sectors); | ||
299 | 293 | ||
300 | if (rq->errors >= ERROR_MAX) { | 294 | if (rq->errors >= ERROR_MAX) { |
301 | if (floppy->failed_pc) | 295 | if (floppy->failed_pc) |
@@ -438,8 +432,9 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) | |||
438 | length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]); | 432 | length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]); |
439 | 433 | ||
440 | ide_debug_log(IDE_DBG_PROBE, "Descriptor %d: %dkB, %d blocks, " | 434 | ide_debug_log(IDE_DBG_PROBE, "Descriptor %d: %dkB, %d blocks, " |
441 | "%d sector size\n", | 435 | "%d sector size", |
442 | i, blocks * length / 1024, blocks, length); | 436 | i, blocks * length / 1024, |
437 | blocks, length); | ||
443 | 438 | ||
444 | if (i) | 439 | if (i) |
445 | continue; | 440 | continue; |
@@ -495,8 +490,8 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) | |||
495 | "in drive\n", drive->name); | 490 | "in drive\n", drive->name); |
496 | break; | 491 | break; |
497 | } | 492 | } |
498 | ide_debug_log(IDE_DBG_PROBE, "Descriptor 0 Code: %d\n", | 493 | ide_debug_log(IDE_DBG_PROBE, "Descriptor 0 Code: %d", |
499 | pc.buf[desc_start + 4] & 0x03); | 494 | pc.buf[desc_start + 4] & 0x03); |
500 | } | 495 | } |
501 | 496 | ||
502 | /* Clik! disk does not support get_flexible_disk_page */ | 497 | /* Clik! disk does not support get_flexible_disk_page */ |
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 047109419902..c51a35093ae2 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c | |||
@@ -182,7 +182,7 @@ static int ide_gd_open(struct block_device *bdev, fmode_t mode) | |||
182 | 182 | ||
183 | drive = idkp->drive; | 183 | drive = idkp->drive; |
184 | 184 | ||
185 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 185 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
186 | 186 | ||
187 | idkp->openers++; | 187 | idkp->openers++; |
188 | 188 | ||
@@ -232,7 +232,7 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode) | |||
232 | struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); | 232 | struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); |
233 | ide_drive_t *drive = idkp->drive; | 233 | ide_drive_t *drive = idkp->drive; |
234 | 234 | ||
235 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 235 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
236 | 236 | ||
237 | if (idkp->openers == 1) | 237 | if (idkp->openers == 1) |
238 | drive->disk_ops->flush(drive); | 238 | drive->disk_ops->flush(drive); |
diff --git a/drivers/ide/ide-gd.h b/drivers/ide/ide-gd.h index b604bdd318a1..70b43765327d 100644 --- a/drivers/ide/ide-gd.h +++ b/drivers/ide/ide-gd.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #define IDE_GD_DEBUG_LOG 0 | 8 | #define IDE_GD_DEBUG_LOG 0 |
9 | 9 | ||
10 | #if IDE_GD_DEBUG_LOG | 10 | #if IDE_GD_DEBUG_LOG |
11 | #define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, args) | 11 | #define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, ## args) |
12 | #else | 12 | #else |
13 | #define ide_debug_log(lvl, fmt, args...) do {} while (0) | 13 | #define ide_debug_log(lvl, fmt, args...) do {} while (0) |
14 | #endif | 14 | #endif |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 854eba8b2ba3..9a386501b9c1 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1045,10 +1045,11 @@ enum { | |||
1045 | }; | 1045 | }; |
1046 | 1046 | ||
1047 | /* DRV_NAME has to be defined in the driver before using the macro below */ | 1047 | /* DRV_NAME has to be defined in the driver before using the macro below */ |
1048 | #define __ide_debug_log(lvl, fmt, args...) \ | 1048 | #define __ide_debug_log(lvl, fmt, args...) \ |
1049 | { \ | 1049 | { \ |
1050 | if (unlikely(drive->debug_mask & lvl)) \ | 1050 | if (unlikely(drive->debug_mask & lvl)) \ |
1051 | printk(KERN_INFO DRV_NAME ": " fmt, ## args); \ | 1051 | printk(KERN_INFO DRV_NAME ": %s: " fmt "\n", \ |
1052 | __func__, ## args); \ | ||
1052 | } | 1053 | } |
1053 | 1054 | ||
1054 | /* | 1055 | /* |