Skip to content

Commit

Permalink
ide-cd: coding style fixes for cdrom_get_toc_entry()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 1, 2008
1 parent a1bb945 commit 5c937ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,11 +2014,13 @@ static int cdrom_get_toc_entry(ide_drive_t *drive, int track,

/* Check validity of requested track number. */
ntracks = toc->hdr.last_track - toc->hdr.first_track + 1;
if (toc->hdr.first_track == CDROM_LEADOUT) ntracks = 0;

if (toc->hdr.first_track == CDROM_LEADOUT)
ntracks = 0;

if (track == CDROM_LEADOUT)
*ent = &toc->ent[ntracks];
else if (track < toc->hdr.first_track ||
track > toc->hdr.last_track)
else if (track < toc->hdr.first_track || track > toc->hdr.last_track)
return -EINVAL;
else
*ent = &toc->ent[track - toc->hdr.first_track];
Expand Down

0 comments on commit 5c937ae

Please sign in to comment.