linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH 7/15] ide: remove atapi_ireason_t
Date: Sun, 04 Nov 2007 17:57:26 +0300	[thread overview]
Message-ID: <472DDDD6.8030806@ru.mvista.com> (raw)
In-Reply-To: <200711022121.24688.bzolnier@gmail.com>

Bartlomiej Zolnierkiewicz wrote:

> [PATCH] ide: remove atapi_ireason_t (take 2)

> Remove atapi_ireason_t.

> While at it:
> * replace 'HWIF(drive)' by 'drive->hwif' (or just 'hwif' where possible)

> v2:
> * v1 had CD and IO bits reversed in many places.

> * Use CD and IO defines from <linux/hdreg.h>.

    You're reading my mind. :-)

> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

> Index: b/drivers/ide/ide-floppy.c
> ===================================================================
> --- a/drivers/ide/ide-floppy.c
> +++ b/drivers/ide/ide-floppy.c
> @@ -788,12 +788,11 @@ static ide_startstop_t idefloppy_pc_intr
>  {
>  	idefloppy_floppy_t *floppy = drive->driver_data;
>  	ide_hwif_t *hwif = drive->hwif;
> -	atapi_ireason_t ireason;
>  	idefloppy_pc_t *pc = floppy->pc;
>  	struct request *rq = pc->rq;
>  	unsigned int temp;
>  	u16 bcount;
> -	u8 stat;
> +	u8 stat, ireason;
>  
>  	debug_log(KERN_INFO "ide-floppy: Reached %s interrupt handler\n",
>  		__FUNCTION__);
> @@ -852,18 +851,18 @@ static ide_startstop_t idefloppy_pc_intr
>  	bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
>  		  hwif->INB(IDE_BCOUNTL_REG);
>  	/* on this interrupt */
> -	ireason.all = HWIF(drive)->INB(IDE_IREASON_REG);
> +	ireason = hwif->INB(IDE_IREASON_REG);
>  
> -	if (ireason.b.cod) {
> +	if (ireason & CD) {
>  		printk(KERN_ERR "ide-floppy: CoD != 0 in idefloppy_pc_intr\n");
>  		return ide_do_reset(drive);
>  	}
> -	if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) {
> +	if ((ireason & IO) == test_bit(PC_WRITING, &pc->flags)) {

    This won't work as IO is 0x02 and test_bit() returns 0 or 1.

[...]
> Index: b/drivers/ide/ide-tape.c
> ===================================================================
> --- a/drivers/ide/ide-tape.c
> +++ b/drivers/ide/ide-tape.c
[...]
> @@ -1965,18 +1964,18 @@ static ide_startstop_t idetape_pc_intr (
>  	bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
>  		  hwif->INB(IDE_BCOUNTL_REG);
>  
> -	ireason.all = hwif->INB(IDE_IREASON_REG);
> +	ireason = hwif->INB(IDE_IREASON_REG);
>  
> -	if (ireason.b.cod) {
> +	if (ireason & CD) {
>  		printk(KERN_ERR "ide-tape: CoD != 0 in idetape_pc_intr\n");
>  		return ide_do_reset(drive);
>  	}
> -	if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) {
> +	if ((ireason & IO) == test_bit(PC_WRITING, &pc->flags)) {

    This won't work either...

[...]

MBR, Sergei

  reply	other threads:[~2007-11-04 14:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 23:28 [PATCH 7/15] ide: remove atapi_ireason_t Bartlomiej Zolnierkiewicz
2007-11-02 20:21 ` Bartlomiej Zolnierkiewicz
2007-11-04 14:57   ` Sergei Shtylyov [this message]
2007-11-05 20:24     ` Bartlomiej Zolnierkiewicz
2007-11-06 18:01       ` Sergei Shtylyov

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=472DDDD6.8030806@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).