aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cdrom/cdrom.c6
-rw-r--r--drivers/ide/ide-cd.c18
-rw-r--r--include/linux/cdrom.h14
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
2790static inline
2791int 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
1667static inline
1668void 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
1679static inline
1680int msf_to_lba (byte m, byte s, byte f)
1681{
1682 return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
1683}
1684
1685static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) 1667static 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
1188extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med); 1188extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med);
1189 1189
1190static 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
1200static 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 */