Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266569AbUAWPLU (ORCPT ); Fri, 23 Jan 2004 10:11:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266570AbUAWPLT (ORCPT ); Fri, 23 Jan 2004 10:11:19 -0500 Received: from mion.elka.pw.edu.pl ([194.29.160.35]:5045 "EHLO mion.elka.pw.edu.pl") by vger.kernel.org with ESMTP id S266569AbUAWPKa (ORCPT ); Fri, 23 Jan 2004 10:10:30 -0500 From: Bartlomiej Zolnierkiewicz To: Pascal Schmidt Subject: Re: [PATCH] make ide-cd handle non-2kB sector sizes Date: Fri, 23 Jan 2004 16:12:47 +0100 User-Agent: KMail/1.5.3 References: In-Reply-To: Cc: Jens Axboe , MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401231612.47506.bzolnier@elka.pw.edu.pl> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1568 Lines: 47 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/