lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091125170300.5446.25122.sendpatchset@localhost>
Date:	Wed, 25 Nov 2009 18:03:00 +0100
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	linux-ide@...r.kernel.org
Cc:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 06/86] pata_artop: unify ->prereset methods

From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Subject: [PATCH] pata_artop: unify ->prereset methods

We can use the same ->prereset method for ATP850 and ATP86xR chipsets.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
---
 drivers/ata/pata_artop.c |   28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

Index: b/drivers/ata/pata_artop.c
===================================================================
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -39,30 +39,15 @@
 
 static int clock = 0;
 
-static int atp850_pre_reset(struct ata_link *link, unsigned long deadline)
-{
-	struct ata_port *ap = link->ap;
-	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-	const struct pci_bits artop_enable_bits[] = {
-		{ 0x4AU, 1U, 0x02UL, 0x02UL },	/* port 0 */
-		{ 0x4AU, 1U, 0x04UL, 0x04UL },	/* port 1 */
-	};
-
-	if (!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
-		return -ENOENT;
-
-	return ata_sff_prereset(link, deadline);
-}
-
 /**
- *	atp86x_pre_reset	-	probe begin
+ *	atp8xx_prereset	-	probe begin
  *	@link: link
  *	@deadline: deadline jiffies for the operation
  *
  *	Nothing complicated needed here.
  */
 
-static int atp86x_pre_reset(struct ata_link *link, unsigned long deadline)
+static int atp8xx_prereset(struct ata_link *link, unsigned long deadline)
 {
 	static const struct pci_bits artop_enable_bits[] = {
 		{ 0x4AU, 1U, 0x02UL, 0x02UL },	/* port 0 */
@@ -72,8 +57,9 @@ static int atp86x_pre_reset(struct ata_l
 	struct ata_port *ap = link->ap;
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 
-	/* Odd numbered device ids are the units with enable bits (the -R cards) */
-	if (pdev->device % 1 && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
+	/* Odd numbered device ids are the units with enable bits. */
+	if (pdev->device % 1 &&
+	    !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
 		return -ENOENT;
 
 	return ata_sff_prereset(link, deadline);
@@ -317,7 +303,7 @@ static struct ata_port_operations atp850
 	.cable_detect		= ata_cable_40wire,
 	.set_piomode		= atp850_set_piomode,
 	.set_dmamode		= atp850_set_dmamode,
-	.prereset		= atp850_pre_reset,
+	.prereset		= atp8xx_prereset,
 	.qc_defer		= atp850_qc_defer,
 };
 
@@ -326,7 +312,7 @@ static struct ata_port_operations atp86x
 	.cable_detect		= atp86x_cable_detect,
 	.set_piomode		= atp86x_set_piomode,
 	.set_dmamode		= atp86x_set_dmamode,
-	.prereset		= atp86x_pre_reset,
+	.prereset		= atp8xx_prereset,
 };
 
 static void atp8xx_fixup(struct pci_dev *pdev)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ