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 | 5c937ae4e7928f825dde2713e9ebba68d50ece6c (patch) | |
tree | 775bc56ccdb98e98a8923b2e585ac004b9cf3f77 /drivers/ide/ide-cd.c | |
parent | a1bb9457f06439f22571e93bddcca63144a08296 (diff) |
ide-cd: coding style fixes for cdrom_get_toc_entry()
This is a preparation to move code handling cdrom.c IOCTLs out of ide-cd.c.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index ee52c8a25945..c92f0d4d4524 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -2014,11 +2014,13 @@ static int cdrom_get_toc_entry(ide_drive_t *drive, int track, | |||
2014 | 2014 | ||
2015 | /* Check validity of requested track number. */ | 2015 | /* Check validity of requested track number. */ |
2016 | ntracks = toc->hdr.last_track - toc->hdr.first_track + 1; | 2016 | ntracks = toc->hdr.last_track - toc->hdr.first_track + 1; |
2017 | if (toc->hdr.first_track == CDROM_LEADOUT) ntracks = 0; | 2017 | |
2018 | if (toc->hdr.first_track == CDROM_LEADOUT) | ||
2019 | ntracks = 0; | ||
2020 | |||
2018 | if (track == CDROM_LEADOUT) | 2021 | if (track == CDROM_LEADOUT) |
2019 | *ent = &toc->ent[ntracks]; | 2022 | *ent = &toc->ent[ntracks]; |
2020 | else if (track < toc->hdr.first_track || | 2023 | else if (track < toc->hdr.first_track || track > toc->hdr.last_track) |
2021 | track > toc->hdr.last_track) | ||
2022 | return -EINVAL; | 2024 | return -EINVAL; |
2023 | else | 2025 | else |
2024 | *ent = &toc->ent[track - toc->hdr.first_track]; | 2026 | *ent = &toc->ent[track - toc->hdr.first_track]; |