Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=481c8c6476f86d7e92435764ba710315d644a45e Commit: 481c8c6476f86d7e92435764ba710315d644a45e Parent: f18f960c5c1568fa2f720e2cb31d6c1af9ea1e1a Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> AuthorDate: Fri Feb 1 23:09:20 2008 +0100 Committer: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> CommitDate: Fri Feb 1 23:09:20 2008 +0100
ide-cd: cleanup ide_cdrom_update_speed() Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> --- drivers/ide/ide-cd.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index f02ddc5..0f6d2e0 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -2416,19 +2416,20 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, struct atapi_capabilities_pag 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 - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html