diff options
-rw-r--r-- | drivers/cdrom/cdrom.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 18 | ||||
-rw-r--r-- | include/linux/cdrom.h | 14 |
3 files changed, 14 insertions, 24 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index af0561053167..47e5b40510cb 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -2787,12 +2787,6 @@ int cdrom_ioctl(struct file * file, struct cdrom_device_info *cdi, | |||
2787 | return -ENOSYS; | 2787 | return -ENOSYS; |
2788 | } | 2788 | } |
2789 | 2789 | ||
2790 | static inline | ||
2791 | int msf_to_lba(char m, char s, char f) | ||
2792 | { | ||
2793 | return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; | ||
2794 | } | ||
2795 | |||
2796 | /* | 2790 | /* |
2797 | * Required when we need to use READ_10 to issue other than 2048 block | 2791 | * Required when we need to use READ_10 to issue other than 2048 block |
2798 | * reads | 2792 | * reads |
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; |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index fcdc11b9609b..a5cd2047624e 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -1187,6 +1187,20 @@ struct media_event_desc { | |||
1187 | 1187 | ||
1188 | extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med); | 1188 | extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med); |
1189 | 1189 | ||
1190 | static inline void lba_to_msf(int lba, u8 *m, u8 *s, u8 *f) | ||
1191 | { | ||
1192 | lba += CD_MSF_OFFSET; | ||
1193 | lba &= 0xffffff; /* negative lbas use only 24 bits */ | ||
1194 | *m = lba / (CD_SECS * CD_FRAMES); | ||
1195 | lba %= (CD_SECS * CD_FRAMES); | ||
1196 | *s = lba / CD_FRAMES; | ||
1197 | *f = lba % CD_FRAMES; | ||
1198 | } | ||
1199 | |||
1200 | static inline int msf_to_lba(u8 m, u8 s, u8 f) | ||
1201 | { | ||
1202 | return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; | ||
1203 | } | ||
1190 | #endif /* End of kernel only stuff */ | 1204 | #endif /* End of kernel only stuff */ |
1191 | 1205 | ||
1192 | #endif /* _LINUX_CDROM_H */ | 1206 | #endif /* _LINUX_CDROM_H */ |