All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: benh@kernel.crashing.org
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [git patches] IDE updates (part 2)
Date: Sun, 14 Oct 2007 18:07:23 +0200	[thread overview]
Message-ID: <200710141807.24295.bzolnier@gmail.com> (raw)
In-Reply-To: <1192320489.22054.40.camel@pasglop>

On Sunday 14 October 2007, Benjamin Herrenschmidt wrote:
> 
> On Sun, 2007-10-14 at 00:41 +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Sunday 14 October 2007, Alan Cox wrote:
> > > > > > 		/* Probably a PCI interface... */
> > > > > > 		for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i)
> > > > > > 			hw->io_ports[i] = data_port + i - IDE_DATA_OFFSET;
> > > > > > 		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
> > > 
> > > Ok so in actual fact
> > > 
> > > - The piece of code above can't be executed anyway
> > > - The ctrl_port argument is not needed ?
> > 
> > pmac_ide_init_hwif_ports() is also called by ide_init_hwif_ports()
> > through ppc_ide_md.init_hwif.
> 
> In which case it should be called with a ctrl_port right ?

Yep.

How's about this patch?

[PATCH] ide-pmac: fix pmac_ide_init_hwif_ports()

* pmac_ide_init_hwif_ports() can be called by ide_init_hwif_ports()
  (through ppc_ide_md.ide_init_hwif hook) for non IDE PMAC interfaces.
  If this is the case the hw->io_ports[] should be already setup by
  ide_init_hwif_ports()->ide_std_init_ports() so remove redundant code
  from pmac_ide_init_hwif_ports().

  As side-effect this change fixes ctl_addr == 0 special handling in
  ide_init_hwif_ports().

* Fix misleading comment while at it.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ppc/pmac.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Index: b/drivers/ide/ppc/pmac.c
===================================================================
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -438,13 +438,8 @@ pmac_ide_init_hwif_ports(hw_regs_t *hw,
 		if (data_port == pmac_ide[ix].regbase)
 			break;
 
-	if (ix >= MAX_HWIFS) {
-		/* Probably a PCI interface... */
-		for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i)
-			hw->io_ports[i] = data_port + i - IDE_DATA_OFFSET;
-		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
-		return;
-	}
+	if (ix >= MAX_HWIFS)
+		return;		/* not an IDE PMAC interface */
 
 	for (i = 0; i < 8; ++i)
 		hw->io_ports[i] = data_port + i * 0x10;

  reply	other threads:[~2007-10-14 16:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-13 16:25 [git patches] IDE updates (part 2) Bartlomiej Zolnierkiewicz
2007-10-13 19:56 ` Alan Cox
2007-10-13 20:59   ` Bartlomiej Zolnierkiewicz
2007-10-13 21:44     ` Alan Cox
2007-10-13 22:09       ` Bartlomiej Zolnierkiewicz
2007-10-13 22:29         ` Alan Cox
2007-10-13 22:41           ` Bartlomiej Zolnierkiewicz
2007-10-14  0:08             ` Benjamin Herrenschmidt
2007-10-14 16:07               ` Bartlomiej Zolnierkiewicz [this message]
2007-10-14 21:15                 ` Benjamin Herrenschmidt
2007-10-16 19:41                   ` Bartlomiej Zolnierkiewicz
2007-10-14  0:12 ` Al Viro
2007-10-14 16:21   ` Bartlomiej Zolnierkiewicz
2007-10-15 19:54   ` Jeff Garzik
2007-10-15 19:58     ` Russell King
2007-10-15 20:07       ` Jeff Garzik
2007-10-24 12:38         ` Russell King
2007-10-24 12:53           ` Jeff Garzik
2007-10-24 13:12             ` Russell King
2007-10-24 13:20               ` Jeff Garzik
2007-10-16 15:55   ` Russell King
2007-10-25  6:05   ` Jeff Garzik

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=200710141807.24295.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.