lkml.org 
[lkml]   [2004]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] make ide-cd handle non-2kB sector sizes
Date

Hi Pascal!

> --- linux-2.6.2-rc1/drivers/ide/ide-cd.h.orig Thu Jan 22 18:05:04 2004
> +++ linux-2.6.2-rc1/drivers/ide/ide-cd.h Thu Jan 22 18:07:14 2004
> @@ -109,6 +109,7 @@ struct ide_cd_state_flags {
> __u8 door_locked : 1; /* We think that the drive door is locked. */
> __u8 writing : 1; /* the drive is currently writing */
> __u8 reserved : 4;
> + byte sectors_per_frame; /* Current sectors per hw frame */
> byte current_speed; /* Current speed of the drive */
> };

Please don't use 'byte' type in your patch, use 'u8' instead.

> @@ -1346,13 +1332,14 @@ static ide_startstop_t cdrom_seek_intr (
> static ide_startstop_t cdrom_start_seek_continuation (ide_drive_t *drive)
> {
> struct request *rq = HWGROUP(drive)->rq;
> + byte sectors_per_frame = CDROM_STATE_FLAGS(drive)->sectors_per_frame;
> int sector, frame, nskip;
>
> sector = rq->sector;
> - nskip = (sector % SECTORS_PER_FRAME);
> + nskip = (sector % sectors_per_frame);
> if (nskip > 0)
> sector -= nskip;
> - frame = sector / SECTORS_PER_FRAME;
> + frame = sector / sectors_per_frame;
>
> memset(rq->cmd, 0, sizeof(rq->cmd));
> rq->cmd[0] = GPCMD_SEEK;

You can as well clean this up while at it.
We don't need 'nskip' for calculating 'frame',

frame = rq->sector / sectors_per_frame;

should be enough.

--bart

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.188 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site