From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 23/63] ide-cd: cleanup ide_cdrom_update_speed()
Date: Thu, 20 Dec 2007 02:10:11 +0100 [thread overview]
Message-ID: <200712200210.11607.bzolnier@gmail.com> (raw)
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
next reply other threads:[~2007-12-20 1:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-20 1:10 Bartlomiej Zolnierkiewicz [this message]
2007-12-21 12:13 ` [PATCH 23/63] ide-cd: cleanup ide_cdrom_update_speed() Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200712200210.11607.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.