mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: linux-ide@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/5] libata: init probe_ent->private_data in a common loc
Date: Thu, 28 Sep 2006 20:27:55 -0400	[thread overview]
Message-ID: <20060929002755.GC7458@havoc.gtf.org> (raw)
In-Reply-To: <20060929002601.GA7397@havoc.gtf.org>


commit d639ca94188fedbd8cfde1ab4ed9e9878ab2f01e
Author: Jeff Garzik <jeff@garzik.org>
Date:   Thu Sep 28 03:48:18 2006 -0400

    [libata] init probe_ent->private_data in a common location

    Don't write the same code twice, in two different functions, when they
    both call the same initialization function, with the same private_data
    pointer info.

    Also, note a bug found with a FIXME.

    Signed-off-by: Jeff Garzik <jeff@garzik.org>

 drivers/ata/libata-core.c |    1 +
 drivers/ata/libata-sff.c  |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

d639ca94188fedbd8cfde1ab4ed9e9878ab2f01e
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 396493c..72644bd 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5785,6 +5785,7 @@ ata_probe_ent_alloc(struct device *dev, 
 	probe_ent->mwdma_mask = port->mwdma_mask;
 	probe_ent->udma_mask = port->udma_mask;
 	probe_ent->port_ops = port->port_ops;
+	probe_ent->private_data = port->private_data;
 
 	return probe_ent;
 }
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index a620e23..06daaa3 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -828,7 +828,6 @@ ata_pci_init_native_mode(struct pci_dev 
 
 	probe_ent->irq = pdev->irq;
 	probe_ent->irq_flags = IRQF_SHARED;
-	probe_ent->private_data = port[0]->private_data;
 
 	if (ports & ATA_PORT_PRIMARY) {
 		probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0);
@@ -878,7 +877,6 @@ static struct ata_probe_ent *ata_pci_ini
 		return NULL;
 
 	probe_ent->n_ports = 2;
-	probe_ent->private_data = port[0]->private_data;
 
 	if (port_mask & ATA_PORT_PRIMARY) {
 		probe_ent->irq = ATA_PRIMARY_IRQ;
@@ -908,6 +906,8 @@ static struct ata_probe_ent *ata_pci_ini
 				probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
 		}
 		ata_std_ports(&probe_ent->port[1]);
+
+		/* FIXME: could be pointing to stack area; must copy */
 		probe_ent->pinfo2 = port[1];
 	} else
 		probe_ent->dummy_port_mask |= ATA_PORT_SECONDARY;

  parent reply	other threads:[~2006-09-29  0:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29  0:26 [PATCH 0/5] libata: various queued changes Jeff Garzik
2006-09-29  0:26 ` [PATCH 1/5] libata: Use new PCI_VDEVICE() macro Jeff Garzik
2006-09-29  0:27 ` [PATCH 2/5] libata: minor PCI IDE probe fixes and cleanups Jeff Garzik
2006-09-29  0:27 ` Jeff Garzik [this message]
2006-09-29  0:28 ` [PATCH 4/5] libata: Print out Status register Jeff Garzik
2006-09-29  0:28 ` [PATCH 5/5] libata: PCI ID table cleanups 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=20060929002755.GC7458@havoc.gtf.org \
    --to=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --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®