diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:24 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:24 -0500 |
commit | a1bb9457f06439f22571e93bddcca63144a08296 (patch) | |
tree | c4b250183a7b552918fb0b001205d0b81b8ca46d /drivers/ide | |
parent | 5c68429dfe8256c6069555e5851838f8e3175f78 (diff) |
ide-cd: move lba_to_msf() and msf_to_lba() to <linux/cdrom.h>
* Move lba_to_msf() and msf_to_lba() to <linux/cdrom.h>
(use 'u8' type instead of 'byte' while at it).
* Remove msf_to_lba() copy from drivers/cdrom/cdrom.c.
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index d290e19845f8..ee52c8a25945 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1664,24 +1664,6 @@ void msf_from_bcd (struct atapi_msf *msf) | |||
1664 | msf->frame = BCD2BIN(msf->frame); | 1664 | msf->frame = BCD2BIN(msf->frame); |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | static inline | ||
1668 | void lba_to_msf (int lba, byte *m, byte *s, byte *f) | ||
1669 | { | ||
1670 | lba += CD_MSF_OFFSET; | ||
1671 | lba &= 0xffffff; /* negative lbas use only 24 bits */ | ||
1672 | *m = lba / (CD_SECS * CD_FRAMES); | ||
1673 | lba %= (CD_SECS * CD_FRAMES); | ||
1674 | *s = lba / CD_FRAMES; | ||
1675 | *f = lba % CD_FRAMES; | ||
1676 | } | ||
1677 | |||
1678 | |||
1679 | static inline | ||
1680 | int msf_to_lba (byte m, byte s, byte f) | ||
1681 | { | ||
1682 | return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; | ||
1683 | } | ||
1684 | |||
1685 | static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) | 1667 | static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) |
1686 | { | 1668 | { |
1687 | struct request req; | 1669 | struct request req; |