Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a6dc6... Commit: 9a6dc668d9b4d639936c683879eb1e0f92c5b944 Parent: cdf6000d7e332d0f7f14233e71dee489628f5aae Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> AuthorDate: Fri Feb 1 23:09:22 2008 +0100 Committer: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> CommitDate: Fri Feb 1 23:09:22 2008 +0100 ide-cd: use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h> Use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h> and remove the local bcd2bin()/bin2bcd() inlines. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> --- drivers/ide/ide-cd.c | 34 +++++++++++----------------------- 1 files changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 206d038..4bd664d 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -46,6 +46,7 @@ #include <linux/ide.h> #include <linux/completion.h> #include <linux/mutex.h> +#include <linux/bcd.h> #include <scsi/scsi.h> /* For SCSI -> ATAPI command conversion */ @@ -1775,25 +1776,12 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block) * can also be NULL, in which case no sense information is returned. */ -static inline -int bin2bcd (int x) -{ - return (x%10) | ((x/10) << 4); -} - - -static inline -int bcd2bin (int x) -{ - return (x >> 4) * 10 + (x & 0x0f); -} - static void msf_from_bcd (struct atapi_msf *msf) { - msf->minute = bcd2bin (msf->minute); - msf->second = bcd2bin (msf->second); - msf->frame = bcd2bin (msf->frame); + msf->minute = BCD2BIN(msf->minute); + msf->second = BCD2BIN(msf->second); + msf->frame = BCD2BIN(msf->frame); } static inline @@ -2020,8 +2008,8 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) return stat; if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { - toc->hdr.first_track = bcd2bin(toc->hdr.first_track); - toc->hdr.last_track = bcd2bin(toc->hdr.last_track); + toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); + toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); } ntracks = toc->hdr.last_track - toc->hdr.first_track + 1; @@ -2058,8 +2046,8 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) return stat; if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { - toc->hdr.first_track = bin2bcd(CDROM_LEADOUT); - toc->hdr.last_track = bin2bcd(CDROM_LEADOUT); + toc->hdr.first_track = (u8)BIN2BCD(CDROM_LEADOUT); + toc->hdr.last_track = (u8)BIN2BCD(CDROM_LEADOUT); } else { toc->hdr.first_track = CDROM_LEADOUT; toc->hdr.last_track = CDROM_LEADOUT; @@ -2072,14 +2060,14 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) toc->hdr.toc_length = ntohs (toc->hdr.toc_length); if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { - toc->hdr.first_track = bcd2bin(toc->hdr.first_track); - toc->hdr.last_track = bcd2bin(toc->hdr.last_track); + toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); + toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); } for (i = 0; i <= ntracks; i++) { if (info->cd_flags & IDE_CD_FLAG_TOCADDR_AS_BCD) { if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) - toc->ent[i].track = bcd2bin(toc->ent[i].track); + toc->ent[i].track = BCD2BIN(toc->ent[i].track); msf_from_bcd(&toc->ent[i].addr.msf); } toc->ent[i].addr.lba = msf_to_lba (toc->ent[i].addr.msf.minute, - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Jeff Garzik | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Christoph Hellwig | Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scan... |
| Heiko Carstens | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Arjan van de Ven | Re: [GIT]: Networking |
| Jens Axboe | Re: [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Emmanuel Dreyfus | fixing send(2) semantics (kern/29750) |
| Christos Zoulas | Re: Melting down your network [Subject changed] |
| Juan RP | Changing the I/O scheduler on-the-fly |
| Emmanuel Dreyfus | Re: fixing send(2) semantics (kern/29750) |
