diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index af0561053167cd177d89c499c3d9f2b108843d46..47e5b40510cb4655cb031ce7470a81c5b7ebf85e 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, return -ENOSYS; } -static inline -int msf_to_lba(char m, char s, char f) -{ - return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; -} - /* * Required when we need to use READ_10 to issue other than 2048 block * reads diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index d290e19845f89c3b515864d3354d464ae0d5d042..ee52c8a259457374192f8beeb0245cd75d79a8ac 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) msf->frame = BCD2BIN(msf->frame); } -static inline -void lba_to_msf (int lba, byte *m, byte *s, byte *f) -{ - lba += CD_MSF_OFFSET; - lba &= 0xffffff; /* negative lbas use only 24 bits */ - *m = lba / (CD_SECS * CD_FRAMES); - lba %= (CD_SECS * CD_FRAMES); - *s = lba / CD_FRAMES; - *f = lba % CD_FRAMES; -} - - -static inline -int msf_to_lba (byte m, byte s, byte f) -{ - return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; -} - static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) { struct request req; diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index fcdc11b9609b7c2efc4318811375a30574d7c586..a5cd2047624ef4e721914e52cf051521c134f704 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -1187,6 +1187,20 @@ struct media_event_desc { extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med); +static inline void lba_to_msf(int lba, u8 *m, u8 *s, u8 *f) +{ + lba += CD_MSF_OFFSET; + lba &= 0xffffff; /* negative lbas use only 24 bits */ + *m = lba / (CD_SECS * CD_FRAMES); + lba %= (CD_SECS * CD_FRAMES); + *s = lba / CD_FRAMES; + *f = lba % CD_FRAMES; +} + +static inline int msf_to_lba(u8 m, u8 s, u8 f) +{ + return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; +} #endif /* End of kernel only stuff */ #endif /* _LINUX_CDROM_H */