Commit 088b1b88 authored by Borislav Petkov's avatar Borislav Petkov Committed by Bartlomiej Zolnierkiewicz

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: default avatarBorislav Petkov <petkovbb@gmail.com>
parent 70775e9c
...@@ -100,8 +100,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, ...@@ -100,8 +100,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq,
{ {
int log = 0; int log = 0;
ide_debug_log(IDE_DBG_SENSE, "Call %s, sense_key: 0x%x\n", __func__, ide_debug_log(IDE_DBG_SENSE, "sense_key: 0x%x", sense->sense_key);
sense->sense_key);
if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) if (!sense || !rq || (rq->cmd_flags & REQ_QUIET))
return 0; return 0;
...@@ -151,13 +150,12 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, ...@@ -151,13 +150,12 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
unsigned long bio_sectors; unsigned long bio_sectors;
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
ide_debug_log(IDE_DBG_SENSE, "Call %s, error_code: 0x%x, " ide_debug_log(IDE_DBG_SENSE, "error_code: 0x%x, sense_key: 0x%x",
"sense_key: 0x%x\n", __func__, sense->error_code, sense->error_code, sense->sense_key);
sense->sense_key);
if (failed_command) if (failed_command)
ide_debug_log(IDE_DBG_SENSE, "%s: failed cmd: 0x%x\n", ide_debug_log(IDE_DBG_SENSE, "failed cmd: 0x%x",
__func__, failed_command->cmd[0]); failed_command->cmd[0]);
if (!cdrom_log_sense(drive, failed_command, sense)) if (!cdrom_log_sense(drive, failed_command, sense))
return; return;
...@@ -217,7 +215,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, ...@@ -217,7 +215,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
struct request *rq = &info->request_sense_request; struct request *rq = &info->request_sense_request;
ide_debug_log(IDE_DBG_SENSE, "Call %s\n", __func__); ide_debug_log(IDE_DBG_SENSE, "enter");
if (sense == NULL) if (sense == NULL)
sense = &info->sense_data; sense = &info->sense_data;
...@@ -239,7 +237,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, ...@@ -239,7 +237,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
rq->buffer = (void *) failed_command; rq->buffer = (void *) failed_command;
if (failed_command) if (failed_command)
ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n", ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x",
failed_command->cmd[0]); failed_command->cmd[0]);
drive->hwif->rq = NULL; drive->hwif->rq = NULL;
...@@ -252,9 +250,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) ...@@ -252,9 +250,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
struct request *rq = drive->hwif->rq; struct request *rq = drive->hwif->rq;
int nsectors = rq->hard_cur_sectors; int nsectors = rq->hard_cur_sectors;
ide_debug_log(IDE_DBG_FUNC, "Call %s, cmd: 0x%x, uptodate: 0x%x, " ide_debug_log(IDE_DBG_FUNC, "cmd: 0x%x, uptodate: 0x%x, nsectors: %d",
"nsectors: %d\n", __func__, rq->cmd[0], uptodate, rq->cmd[0], uptodate, nsectors);
nsectors);
if (blk_sense_request(rq) && uptodate) { if (blk_sense_request(rq) && uptodate) {
/* /*
...@@ -295,8 +292,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) ...@@ -295,8 +292,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
if (!nsectors) if (!nsectors)
nsectors = 1; nsectors = 1;
ide_debug_log(IDE_DBG_FUNC, "Exit %s, uptodate: 0x%x, nsectors: %d\n", ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d",
__func__, uptodate, nsectors); uptodate, nsectors);
ide_end_request(drive, uptodate, nsectors); ide_end_request(drive, uptodate, nsectors);
} }
...@@ -338,9 +335,10 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) ...@@ -338,9 +335,10 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
return 1; return 1;
} }
ide_debug_log(IDE_DBG_RQ, "%s: stat: 0x%x, good_stat: 0x%x, " ide_debug_log(IDE_DBG_RQ, "stat: 0x%x, good_stat: 0x%x, cmd[0]: 0x%x, "
"rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x, err: 0x%x\n", "rq->cmd_type: 0x%x, err: 0x%x",
__func__, stat, good_stat, rq->cmd[0], rq->cmd_type, err); stat, good_stat, rq->cmd[0], rq->cmd_type,
err);
if (blk_sense_request(rq)) { if (blk_sense_request(rq)) {
/* /*
...@@ -530,8 +528,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, ...@@ -530,8 +528,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
{ {
ide_hwif_t *hwif = drive->hwif; ide_hwif_t *hwif = drive->hwif;
ide_debug_log(IDE_DBG_FUNC, "Call %s, ireason: 0x%x, rw: 0x%x\n", ide_debug_log(IDE_DBG_FUNC, "ireason: 0x%x, rw: 0x%x", ireason, rw);
__func__, ireason, rw);
/* /*
* ireason == 0: the drive wants to receive data from us * 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,7 +569,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
*/ */
static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) static int ide_cd_check_transfer_size(ide_drive_t *drive, int len)
{ {
ide_debug_log(IDE_DBG_FUNC, "Call %s, len: %d\n", __func__, len); ide_debug_log(IDE_DBG_FUNC, "len: %d", len);
if ((len % SECTOR_SIZE) == 0) if ((len % SECTOR_SIZE) == 0)
return 0; return 0;
...@@ -594,8 +591,7 @@ static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) ...@@ -594,8 +591,7 @@ static int ide_cd_check_transfer_size(ide_drive_t *drive, int len)
static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive,
struct request *rq) struct request *rq)
{ {
ide_debug_log(IDE_DBG_RQ, "Call %s: rq->cmd_flags: 0x%x\n", __func__, ide_debug_log(IDE_DBG_RQ, "rq->cmd_flags: 0x%x", rq->cmd_flags);
rq->cmd_flags);
if (rq_data_dir(rq) == READ) { if (rq_data_dir(rq) == READ) {
unsigned short sectors_per_frame = unsigned short sectors_per_frame =
...@@ -639,7 +635,7 @@ static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, ...@@ -639,7 +635,7 @@ static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive,
static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq)
{ {
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
if (rq->buffer != bio_data(rq->bio)) { if (rq->buffer != bio_data(rq->bio)) {
sector_t n = sector_t n =
...@@ -658,8 +654,7 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) ...@@ -658,8 +654,7 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq)
static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq) static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq)
{ {
ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n", ide_debug_log(IDE_DBG_FUNC, "rq->cmd[0]: 0x%x", rq->cmd[0]);
__func__, rq->cmd[0]);
/* /*
* Some of the trailing request sense fields are optional, * 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,9 +681,9 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
if (!sense) if (!sense)
sense = &local_sense; sense = &local_sense;
ide_debug_log(IDE_DBG_PC, "Call %s, cmd[0]: 0x%x, write: 0x%x, " ide_debug_log(IDE_DBG_PC, "cmd[0]: 0x%x, write: 0x%x, timeout: %d, "
"timeout: %d, cmd_flags: 0x%x\n", __func__, cmd[0], write, "cmd_flags: 0x%x",
timeout, cmd_flags); cmd[0], write, timeout, cmd_flags);
/* start of retry loop */ /* start of retry loop */
do { do {
...@@ -772,8 +767,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ...@@ -772,8 +767,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
u16 len; u16 len;
u8 ireason; u8 ireason;
ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x\n", ide_debug_log(IDE_DBG_PC, "cmd[0]: 0x%x, write: 0x%x",
__func__, rq->cmd[0], write); rq->cmd[0], write);
/* check for errors */ /* check for errors */
dma = drive->dma; dma = drive->dma;
...@@ -810,8 +805,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ...@@ -810,8 +805,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
if (thislen > len) if (thislen > len)
thislen = len; thislen = len;
ide_debug_log(IDE_DBG_PC, "%s: DRQ: stat: 0x%x, thislen: %d\n", ide_debug_log(IDE_DBG_PC, "DRQ: stat: 0x%x, thislen: %d",
__func__, stat, thislen); stat, thislen);
/* If DRQ is clear, the command has completed. */ /* If DRQ is clear, the command has completed. */
if ((stat & ATA_DRQ) == 0) { if ((stat & ATA_DRQ) == 0) {
...@@ -876,8 +871,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ...@@ -876,8 +871,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
xferfunc = hwif->tp_ops->input_data; xferfunc = hwif->tp_ops->input_data;
} }
ide_debug_log(IDE_DBG_PC, "%s: data transfer, rq->cmd_type: 0x%x, " ide_debug_log(IDE_DBG_PC, "data transfer, rq->cmd_type: 0x%x, "
"ireason: 0x%x\n", __func__, rq->cmd_type, ireason); "ireason: 0x%x",
rq->cmd_type, ireason);
/* transfer data */ /* transfer data */
while (thislen > 0) { while (thislen > 0) {
...@@ -988,9 +984,9 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq) ...@@ -988,9 +984,9 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)
unsigned short sectors_per_frame = unsigned short sectors_per_frame =
queue_hardsect_size(drive->queue) >> SECTOR_BITS; queue_hardsect_size(drive->queue) >> SECTOR_BITS;
ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, " ide_debug_log(IDE_DBG_RQ, "rq->cmd[0]: 0x%x, write: 0x%x, "
"secs_per_frame: %u\n", "secs_per_frame: %u",
__func__, rq->cmd[0], write, sectors_per_frame); rq->cmd[0], write, sectors_per_frame);
if (write) { if (write) {
/* disk has become write protected */ /* disk has become write protected */
...@@ -1026,9 +1022,8 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq) ...@@ -1026,9 +1022,8 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)
static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
{ {
ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, " ide_debug_log(IDE_DBG_PC, "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x",
"rq->cmd_type: 0x%x\n", __func__, rq->cmd[0], rq->cmd[0], rq->cmd_type);
rq->cmd_type);
if (blk_pc_request(rq)) if (blk_pc_request(rq))
rq->cmd_flags |= REQ_QUIET; rq->cmd_flags |= REQ_QUIET;
...@@ -1067,10 +1062,11 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) ...@@ -1067,10 +1062,11 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
sector_t block) sector_t block)
{ {
ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, " ide_debug_log(IDE_DBG_RQ, "cmd: 0x%x, block: %llu",
"rq->cmd_type: 0x%x, block: %llu\n", rq->cmd[0], (unsigned long long)block);
__func__, rq->cmd[0], rq->cmd_type,
(unsigned long long)block); if (drive->debug_mask & IDE_DBG_RQ)
blk_dump_rq_flags(rq, "ide_cd_do_request");
if (blk_fs_request(rq)) { if (blk_fs_request(rq)) {
if (cdrom_start_rw(drive, rq) == ide_stopped) 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,7 +1115,7 @@ int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense)
struct cdrom_device_info *cdi = &info->devinfo; struct cdrom_device_info *cdi = &info->devinfo;
unsigned char cmd[BLK_MAX_CDB]; unsigned char cmd[BLK_MAX_CDB];
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
memset(cmd, 0, BLK_MAX_CDB); memset(cmd, 0, BLK_MAX_CDB);
cmd[0] = GPCMD_TEST_UNIT_READY; cmd[0] = GPCMD_TEST_UNIT_READY;
...@@ -1147,7 +1143,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, ...@@ -1147,7 +1143,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
unsigned len = sizeof(capbuf); unsigned len = sizeof(capbuf);
u32 blocklen; u32 blocklen;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
memset(cmd, 0, BLK_MAX_CDB); memset(cmd, 0, BLK_MAX_CDB);
cmd[0] = GPCMD_READ_CDVD_CAPACITY; cmd[0] = GPCMD_READ_CDVD_CAPACITY;
...@@ -1179,8 +1175,8 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, ...@@ -1179,8 +1175,8 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
*capacity = 1 + be32_to_cpu(capbuf.lba); *capacity = 1 + be32_to_cpu(capbuf.lba);
*sectors_per_frame = blocklen >> SECTOR_BITS; *sectors_per_frame = blocklen >> SECTOR_BITS;
ide_debug_log(IDE_DBG_PROBE, "%s: cap: %lu, sectors_per_frame: %lu\n", ide_debug_log(IDE_DBG_PROBE, "cap: %lu, sectors_per_frame: %lu",
__func__, *capacity, *sectors_per_frame); *capacity, *sectors_per_frame);
return 0; return 0;
} }
...@@ -1191,7 +1187,7 @@ static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag, ...@@ -1191,7 +1187,7 @@ static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag,
{ {
unsigned char cmd[BLK_MAX_CDB]; unsigned char cmd[BLK_MAX_CDB];
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
memset(cmd, 0, BLK_MAX_CDB); memset(cmd, 0, BLK_MAX_CDB);
...@@ -1221,7 +1217,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) ...@@ -1221,7 +1217,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
long last_written; long last_written;
unsigned long sectors_per_frame = SECTORS_PER_FRAME; unsigned long sectors_per_frame = SECTORS_PER_FRAME;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
if (toc == NULL) { if (toc == NULL) {
/* try to allocate space */ /* try to allocate space */
...@@ -1383,7 +1379,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, u8 *buf) ...@@ -1383,7 +1379,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, u8 *buf)
struct packet_command cgc; struct packet_command cgc;
int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0) if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0)
size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE;
...@@ -1403,7 +1399,7 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) ...@@ -1403,7 +1399,7 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
struct cdrom_info *cd = drive->driver_data; struct cdrom_info *cd = drive->driver_data;
u16 curspeed, maxspeed; u16 curspeed, maxspeed;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) { if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) {
curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]); curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]);
...@@ -1413,8 +1409,8 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) ...@@ -1413,8 +1409,8 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]); maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]);
} }
ide_debug_log(IDE_DBG_PROBE, "%s: curspeed: %u, maxspeed: %u\n", ide_debug_log(IDE_DBG_PROBE, "curspeed: %u, maxspeed: %u",
__func__, curspeed, maxspeed); curspeed, maxspeed);
cd->current_speed = (curspeed + (176/2)) / 176; cd->current_speed = (curspeed + (176/2)) / 176;
cd->max_speed = (maxspeed + (176/2)) / 176; cd->max_speed = (maxspeed + (176/2)) / 176;
...@@ -1448,7 +1444,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots) ...@@ -1448,7 +1444,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots)
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *devinfo = &info->devinfo; struct cdrom_device_info *devinfo = &info->devinfo;
ide_debug_log(IDE_DBG_PROBE, "Call %s, nslots: %d\n", __func__, nslots); ide_debug_log(IDE_DBG_PROBE, "nslots: %d", nslots);
devinfo->ops = &ide_cdrom_dops; devinfo->ops = &ide_cdrom_dops;
devinfo->speed = info->current_speed; devinfo->speed = info->current_speed;
...@@ -1471,9 +1467,8 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) ...@@ -1471,9 +1467,8 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
mechtype_t mechtype; mechtype_t mechtype;
int nslots = 1; int nslots = 1;
ide_debug_log(IDE_DBG_PROBE, "Call %s, drive->media: 0x%x, " ide_debug_log(IDE_DBG_PROBE, "media: 0x%x, atapi_flags: 0x%lx",
"drive->atapi_flags: 0x%lx\n", __func__, drive->media, drive->media, drive->atapi_flags);
drive->atapi_flags);
cdi->mask = (CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R | cdi->mask = (CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R |
CDC_DVD_RAM | CDC_SELECT_DISC | CDC_PLAY_AUDIO | CDC_DVD_RAM | CDC_SELECT_DISC | CDC_PLAY_AUDIO |
...@@ -1754,7 +1749,7 @@ static int ide_cdrom_setup(ide_drive_t *drive) ...@@ -1754,7 +1749,7 @@ static int ide_cdrom_setup(ide_drive_t *drive)
char *fw_rev = (char *)&id[ATA_ID_FW_REV]; char *fw_rev = (char *)&id[ATA_ID_FW_REV];
int nslots; int nslots;
ide_debug_log(IDE_DBG_PROBE, "Call %s\n", __func__); ide_debug_log(IDE_DBG_PROBE, "enter");
blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
blk_queue_dma_alignment(drive->queue, 31); blk_queue_dma_alignment(drive->queue, 31);
...@@ -1797,7 +1792,7 @@ static void ide_cd_remove(ide_drive_t *drive) ...@@ -1797,7 +1792,7 @@ static void ide_cd_remove(ide_drive_t *drive)
{ {
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
ide_proc_unregister_driver(drive, info->driver); ide_proc_unregister_driver(drive, info->driver);
device_del(&info->dev); device_del(&info->dev);
...@@ -1815,7 +1810,7 @@ static void ide_cd_release(struct device *dev) ...@@ -1815,7 +1810,7 @@ static void ide_cd_release(struct device *dev)
ide_drive_t *drive = info->drive; ide_drive_t *drive = info->drive;
struct gendisk *g = info->disk; struct gendisk *g = info->disk;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
kfree(info->toc); kfree(info->toc);
if (devinfo->handle == drive) if (devinfo->handle == drive)
...@@ -1974,9 +1969,8 @@ static int ide_cd_probe(ide_drive_t *drive) ...@@ -1974,9 +1969,8 @@ static int ide_cd_probe(ide_drive_t *drive)
struct gendisk *g; struct gendisk *g;
struct request_sense sense; struct request_sense sense;
ide_debug_log(IDE_DBG_PROBE, "Call %s, drive->driver_req: %s, " ide_debug_log(IDE_DBG_PROBE, "driver_req: %s, media: 0x%x",
"drive->media: 0x%x\n", __func__, drive->driver_req, drive->driver_req, drive->media);
drive->media);
if (!strstr("ide-cdrom", drive->driver_req)) if (!strstr("ide-cdrom", drive->driver_req))
goto failed; goto failed;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define IDECD_DEBUG_LOG 0 #define IDECD_DEBUG_LOG 0
#if IDECD_DEBUG_LOG #if IDECD_DEBUG_LOG
#define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, args) #define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, ## args)
#else #else
#define ide_debug_log(lvl, fmt, args...) do {} while (0) #define ide_debug_log(lvl, fmt, args...) do {} while (0)
#endif #endif
......
...@@ -74,7 +74,7 @@ static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs) ...@@ -74,7 +74,7 @@ static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
struct request *rq = drive->hwif->rq; struct request *rq = drive->hwif->rq;
int error; int error;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
switch (uptodate) { switch (uptodate) {
case 0: case 0:
...@@ -121,7 +121,7 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) ...@@ -121,7 +121,7 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc)
struct ide_atapi_pc *pc = drive->pc; struct ide_atapi_pc *pc = drive->pc;
int uptodate = pc->error ? 0 : 1; int uptodate = pc->error ? 0 : 1;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");
if (floppy->failed_pc == pc) if (floppy->failed_pc == pc)
floppy->failed_pc = NULL; floppy->failed_pc = NULL;
...@@ -140,11 +140,11 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) ...@@ -140,11 +140,11 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc)
(u16)get_unaligned((u16 *)&buf[16]) : 0x10000; (u16)get_unaligned((u16 *)&buf[16]) : 0x10000;
if (floppy->failed_pc) if (floppy->failed_pc)
ide_debug_log(IDE_DBG_PC, "pc = %x, ", ide_debug_log(IDE_DBG_PC, "pc = %x",
floppy->failed_pc->c[0]); floppy->failed_pc->c[0]);
ide_debug_log(IDE_DBG_SENSE, "sense key = %x, asc = %x," ide_debug_log(IDE_DBG_SENSE, "sense key = %x, asc = %x,"
"ascq = %x\n", floppy->sense_key, "ascq = %x", floppy->sense_key,
floppy->asc, floppy->ascq); floppy->asc, floppy->ascq);
} else } else
printk(KERN_ERR PFX "Error in REQUEST SENSE itself - " 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,7 +193,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
return ide_stopped; return ide_stopped;
} }
ide_debug_log(IDE_DBG_FUNC, "%s: Retry #%d\n", __func__, pc->retries); ide_debug_log(IDE_DBG_FUNC, "retry #%d", pc->retries);
pc->retries++; pc->retries++;
...@@ -242,8 +242,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive, ...@@ -242,8 +242,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive,
int blocks = rq->nr_sectors / floppy->bs_factor; int blocks = rq->nr_sectors / floppy->bs_factor;
int cmd = rq_data_dir(rq); int cmd = rq_data_dir(rq);
ide_debug_log(IDE_DBG_FUNC, "%s: block: %d, blocks: %d\n", __func__, ide_debug_log(IDE_DBG_FUNC, "block: %d, blocks: %d", block, blocks);
block, blocks);
ide_init_pc(pc); ide_init_pc(pc);
pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10; 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,15 +286,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
ide_hwif_t *hwif = drive->hwif; ide_hwif_t *hwif = drive->hwif;
struct ide_atapi_pc *pc; struct ide_atapi_pc *pc;
ide_debug_log(IDE_DBG_FUNC, "%s: dev: %s, cmd: 0x%x, cmd_type: %x, " if (drive->debug_mask & IDE_DBG_RQ)
"errors: %d\n", blk_dump_rq_flags(rq, (rq->rq_disk
__func__, rq->rq_disk ? rq->rq_disk->disk_name : "?", ? rq->rq_disk->disk_name
rq->cmd[0], rq->cmd_type, rq->errors); : "dev?"));
ide_debug_log(IDE_DBG_FUNC, "%s: sector: %ld, nr_sectors: %ld, "
"current_nr_sectors: %d\n",
__func__, (long)rq->sector, rq->nr_sectors,
rq->current_nr_sectors);
if (rq->errors >= ERROR_MAX) { if (rq->errors >= ERROR_MAX) {
if (floppy->failed_pc) if (floppy->failed_pc)
...@@ -438,8 +432,9 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) ...@@ -438,8 +432,9 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]); length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]);
ide_debug_log(IDE_DBG_PROBE, "Descriptor %d: %dkB, %d blocks, " ide_debug_log(IDE_DBG_PROBE, "Descriptor %d: %dkB, %d blocks, "
"%d sector size\n", "%d sector size",
i, blocks * length / 1024, blocks, length); i, blocks * length / 1024,
blocks, length);
if (i) if (i)
continue; continue;
...@@ -495,7 +490,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) ...@@ -495,7 +490,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
"in drive\n", drive->name); "in drive\n", drive->name);
break; break;
} }
ide_debug_log(IDE_DBG_PROBE, "Descriptor 0 Code: %d\n", ide_debug_log(IDE_DBG_PROBE, "Descriptor 0 Code: %d",
pc.buf[desc_start + 4] & 0x03); pc.buf[desc_start + 4] & 0x03);
} }
......
...@@ -182,7 +182,7 @@ static int ide_gd_open(struct block_device *bdev, fmode_t mode) ...@@ -182,7 +182,7 @@ static int ide_gd_open(struct block_device *bdev, fmode_t mode)
drive = idkp->drive; drive = idkp->drive;
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "enter");