* [PATCH 23/63] ide-cd: cleanup ide_cdrom_update_speed()
@ 2007-12-20 1:10 Bartlomiej Zolnierkiewicz
2007-12-21 12:13 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-12-20 1:10 UTC (permalink / raw)
To: linux-ide; +Cc: linux-kernel
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
-39 bytes
drivers/ide/ide-cd.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -2395,19 +2395,20 @@ int ide_cdrom_get_capabilities(ide_drive
static
void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page *cap)
{
+ u16 curspeed, maxspeed;
+
/* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */
if (!drive->id->model[0] &&
!strncmp(drive->id->fw_rev, "241N", 4)) {
- CDROM_STATE_FLAGS(drive)->current_speed =
- (le16_to_cpu(cap->curspeed) + (176/2)) / 176;
- CDROM_CONFIG_FLAGS(drive)->max_speed =
- (le16_to_cpu(cap->maxspeed) + (176/2)) / 176;
+ curspeed = le16_to_cpu(cap->curspeed);
+ maxspeed = le16_to_cpu(cap->maxspeed);
} else {
- CDROM_STATE_FLAGS(drive)->current_speed =
- (be16_to_cpu(cap->curspeed) + (176/2)) / 176;
- CDROM_CONFIG_FLAGS(drive)->max_speed =
- (be16_to_cpu(cap->maxspeed) + (176/2)) / 176;
+ curspeed = be16_to_cpu(cap->curspeed);
+ maxspeed = be16_to_cpu(cap->maxspeed);
}
+
+ CDROM_STATE_FLAGS(drive)->current_speed = (curspeed + (176/2)) / 176;
+ CDROM_CONFIG_FLAGS(drive)->max_speed = (maxspeed + (176/2)) / 176;
}
static
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-21 12:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20 1:10 [PATCH 23/63] ide-cd: cleanup ide_cdrom_update_speed() Bartlomiej Zolnierkiewicz
2007-12-21 12:13 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).