[PATCH 02/63] ide-cd: fix ACER/AOpen 24X CDROM speed reporting on big-endian machines
From: Bartlomiej Zolnierkiewicz
Date: Wed Dec 19 2007 - 20:34:51 EST
* Fix ACER/AOpen 24X CDROM speed reporting on big-endian machines
by adding missing le16_to_cpu() calls.
While at it:
* Replace ntohs() by be16_to_cpu().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
drivers/ide/ide-cd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -2682,14 +2682,14 @@ void ide_cdrom_update_speed (ide_drive_t
if (!drive->id->model[0] &&
!strncmp(drive->id->fw_rev, "241N", 4)) {
CDROM_STATE_FLAGS(drive)->current_speed =
- (((unsigned int)cap->curspeed) + (176/2)) / 176;
+ (le16_to_cpu(cap->curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS(drive)->max_speed =
- (((unsigned int)cap->maxspeed) + (176/2)) / 176;
+ (le16_to_cpu(cap->maxspeed) + (176/2)) / 176;
} else {
CDROM_STATE_FLAGS(drive)->current_speed =
- (ntohs(cap->curspeed) + (176/2)) / 176;
+ (be16_to_cpu(cap->curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS(drive)->max_speed =
- (ntohs(cap->maxspeed) + (176/2)) / 176;
+ (be16_to_cpu(cap->maxspeed) + (176/2)) / 176;
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/