aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-04-26 16:25:15 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:15 -0400
commite5e076a3540af0ed7b6491d1593396c99adbfbe1 (patch)
treec39040f28b299b3bcf19498629a99b5a0550120f /drivers/ide/ide-cd.c
parent83c8565dcc9daa4b28fd6ffe63308d64656ce4db (diff)
ide-cd: fix remaining checkpatch.pl issues
Some of them are: WARNING: braces {} are not necessary for single statement blocks CHECK: multiple assignments should be avoided WARNING: printk() should include KERN_ facility level WARNING: no space between function name and open parenthesis '(' [bart: minor fixups] Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 0a45f557d338..fcd33f17d8fe 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -136,8 +136,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq,
136 return log; 136 return log;
137} 137}
138 138
139static 139static void cdrom_analyze_sense_data(ide_drive_t *drive,
140void cdrom_analyze_sense_data(ide_drive_t *drive,
141 struct request *failed_command, 140 struct request *failed_command,
142 struct request_sense *sense) 141 struct request_sense *sense)
143{ 142{
@@ -186,9 +185,8 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
186 if (valid < 0) 185 if (valid < 0)
187 valid = 0; 186 valid = 0;
188 if (sector < get_capacity(info->disk) && 187 if (sector < get_capacity(info->disk) &&
189 drive->probed_capacity - sector < 4 * 75) { 188 drive->probed_capacity - sector < 4 * 75)
190 set_capacity(info->disk, sector); 189 set_capacity(info->disk, sector);
191 }
192 } 190 }
193 } 191 }
194 192
@@ -219,7 +217,8 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
219 217
220 rq->data = sense; 218 rq->data = sense;
221 rq->cmd[0] = GPCMD_REQUEST_SENSE; 219 rq->cmd[0] = GPCMD_REQUEST_SENSE;
222 rq->cmd[4] = rq->data_len = 18; 220 rq->cmd[4] = 18;
221 rq->data_len = 18;
223 222
224 rq->cmd_type = REQ_TYPE_SENSE; 223 rq->cmd_type = REQ_TYPE_SENSE;
225 224
@@ -310,7 +309,8 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
310 sense_key = err >> 4; 309 sense_key = err >> 4;
311 310
312 if (rq == NULL) { 311 if (rq == NULL) {
313 printk("%s: missing rq in cdrom_decode_status\n", drive->name); 312 printk(KERN_ERR "%s: missing rq in %s\n",
313 drive->name, __func__);
314 return 1; 314 return 1;
315 } 315 }
316 316
@@ -379,7 +379,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
379 cdrom_saw_media_change(drive); 379 cdrom_saw_media_change(drive);
380 380
381 /* fail the request */ 381 /* fail the request */
382 printk("%s: tray open\n", drive->name); 382 printk(KERN_ERR "%s: tray open\n", drive->name);
383 do_end_request = 1; 383 do_end_request = 1;
384 } else { 384 } else {
385 struct cdrom_info *info = drive->driver_data; 385 struct cdrom_info *info = drive->driver_data;
@@ -411,7 +411,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
411 } 411 }
412 } else if (sense_key == UNIT_ATTENTION) { 412 } else if (sense_key == UNIT_ATTENTION) {
413 /* media change */ 413 /* media change */
414 cdrom_saw_media_change (drive); 414 cdrom_saw_media_change(drive);
415 415
416 /* 416 /*
417 * Arrange to retry the request but be sure to give up 417 * Arrange to retry the request but be sure to give up
@@ -1215,8 +1215,8 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
1215/* 1215/*
1216 * cdrom driver request routine. 1216 * cdrom driver request routine.
1217 */ 1217 */
1218static ide_startstop_t 1218static ide_startstop_t ide_do_rw_cdrom(ide_drive_t *drive, struct request *rq,
1219ide_do_rw_cdrom(ide_drive_t *drive, struct request *rq, sector_t block) 1219 sector_t block)
1220{ 1220{
1221 ide_startstop_t action; 1221 ide_startstop_t action;
1222 struct cdrom_info *info = drive->driver_data; 1222 struct cdrom_info *info = drive->driver_data;
@@ -1271,8 +1271,7 @@ ide_do_rw_cdrom(ide_drive_t *drive, struct request *rq, sector_t block)
1271 * subsequent request sense command. The pointer can also be NULL, in which case 1271 * subsequent request sense command. The pointer can also be NULL, in which case
1272 * no sense information is returned. 1272 * no sense information is returned.
1273 */ 1273 */
1274static 1274static void msf_from_bcd(struct atapi_msf *msf)
1275void msf_from_bcd(struct atapi_msf *msf)
1276{ 1275{
1277 msf->minute = BCD2BIN(msf->minute); 1276 msf->minute = BCD2BIN(msf->minute);
1278 msf->second = BCD2BIN(msf->second); 1277 msf->second = BCD2BIN(msf->second);
@@ -1487,7 +1486,8 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
1487 1486
1488 toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba); 1487 toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
1489 } else { 1488 } else {
1490 ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT; 1489 ms_tmp.hdr.last_track = CDROM_LEADOUT;
1490 ms_tmp.hdr.first_track = ms_tmp.hdr.last_track;
1491 toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */ 1491 toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */
1492 } 1492 }
1493 1493
@@ -1601,8 +1601,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots)
1601 return register_cdrom(devinfo); 1601 return register_cdrom(devinfo);
1602} 1602}
1603 1603
1604static 1604static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
1605int ide_cdrom_probe_capabilities(ide_drive_t *drive)
1606{ 1605{
1607 struct cdrom_info *cd = drive->driver_data; 1606 struct cdrom_info *cd = drive->driver_data;
1608 struct cdrom_device_info *cdi = &cd->devinfo; 1607 struct cdrom_device_info *cdi = &cd->devinfo;
@@ -1792,8 +1791,8 @@ static sector_t ide_cdrom_capacity(ide_drive_t *drive)
1792 return capacity * sectors_per_frame; 1791 return capacity * sectors_per_frame;
1793} 1792}
1794 1793
1795static int proc_idecd_read_capacity 1794static int proc_idecd_read_capacity(char *page, char **start, off_t off,
1796 (char *page, char **start, off_t off, int count, int *eof, void *data) 1795 int count, int *eof, void *data)
1797{ 1796{
1798 ide_drive_t *drive = data; 1797 ide_drive_t *drive = data;
1799 int len; 1798 int len;
@@ -1873,8 +1872,7 @@ static unsigned int ide_cd_flags(struct hd_driveid *id)
1873 return 0; 1872 return 0;
1874} 1873}
1875 1874
1876static 1875static int ide_cdrom_setup(ide_drive_t *drive)
1877int ide_cdrom_setup(ide_drive_t *drive)
1878{ 1876{
1879 struct cdrom_info *cd = drive->driver_data; 1877 struct cdrom_info *cd = drive->driver_data;
1880 struct cdrom_device_info *cdi = &cd->devinfo; 1878 struct cdrom_device_info *cdi = &cd->devinfo;