mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Pascal Schmidt <der.eremit@email.de>
Cc: Jens Axboe <axboe@suse.de>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] make ide-cd handle non-2kB sector sizes
Date: Fri, 23 Jan 2004 16:12:47 +0100	[thread overview]
Message-ID: <200401231612.47506.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <Pine.LNX.4.44.0401222014390.1296-100000@neptune.local>


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


  parent reply	other threads:[~2004-01-23 15:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 19:23 Pascal Schmidt
2004-01-23  9:35 ` Jens Axboe
2004-01-23 14:01   ` Pascal Schmidt
2004-01-23 15:24     ` Bartlomiej Zolnierkiewicz
2004-01-23 16:18       ` Jens Axboe
2004-01-23 17:37         ` Pascal Schmidt
2004-01-23 18:50         ` Pascal Schmidt
2004-01-23 23:29           ` Pascal Schmidt
2004-01-23 23:50             ` Bartlomiej Zolnierkiewicz
2004-01-24  0:06               ` Pascal Schmidt
2004-01-24  0:57               ` Pascal Schmidt
2004-01-23 17:36       ` Pascal Schmidt
2004-01-23 15:12 ` Bartlomiej Zolnierkiewicz [this message]
2004-01-23 18:58 ` Maciej W. Rozycki
2004-01-23 19:04   ` Pascal Schmidt
2004-01-23 19:17     ` Maciej W. Rozycki
2004-01-23 19:56       ` Pascal Schmidt
2004-01-23 22:10         ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401231612.47506.bzolnier@elka.pw.edu.pl \
    --to=b.zolnierkiewicz@elka.pw.edu.pl \
    --cc=axboe@suse.de \
    --cc=der.eremit@email.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®