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-next>] [day] [month] [year] [list]
Message-Id: <1195581124.23700.262.camel@queen.suse.de>
Date:	Tue, 20 Nov 2007 18:52:04 +0100
From:	Thomas Renninger <trenn@...e.de>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Cc:	akpm <akpm@...ux-foundation.org>,
	Bjorn Helgaas <bjorn.helgaas@...com>,
	"Li, Shaohua" <shaohua.li@...el.com>,
	"yakui.zhao" <yakui.zhao@...el.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Rene Herman <rene.herman@...access.nl>
Subject: [PATCH 3/3] PNP cleanups - Version 2 - Pass struct pnp_dev to  
	pnp_clean_resource_table for cleanup reasons

Pass struct pnp_dev to pnp_clean_resource_table for cleanup reasons

Signed-off-by: Thomas Renninger <trenn@...e.de>

---
 drivers/pnp/manager.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

Index: linux-2.6.24-rc2-mm1/drivers/pnp/manager.c
===================================================================
--- linux-2.6.24-rc2-mm1.orig/drivers/pnp/manager.c
+++ linux-2.6.24-rc2-mm1/drivers/pnp/manager.c
@@ -235,38 +235,38 @@ void pnp_init_resource_table(struct pnp_
  * pnp_clean_resources - clears resources that were not manually set
  * @res: the resources to clean
  */
-static void pnp_clean_resource_table(struct pnp_resource_table *res)
+static void pnp_clean_resource_table(struct pnp_dev *dev)
 {
 	int idx;
 
 	for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
-		if (!(res->irq_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_irq_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->irq_resource[idx].start = -1;
-		res->irq_resource[idx].flags =
+		pnp_irq_no(dev, idx) = -1;
+		pnp_irq_flags(dev, idx) =
 		    IORESOURCE_IRQ | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_DMA; idx++) {
-		if (!(res->dma_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_dma_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->dma_resource[idx].start = -1;
-		res->dma_resource[idx].flags =
+		pnp_dma_no(dev, idx) = -1;
+		pnp_dma_flags(dev, idx) =
 		    IORESOURCE_DMA | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_PORT; idx++) {
-		if (!(res->port_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_port_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->port_resource[idx].start = 0;
-		res->port_resource[idx].end = 0;
-		res->port_resource[idx].flags =
+		pnp_port_start(dev, idx) = 0;
+		pnp_port_end(dev, idx) = 0;
+		pnp_port_flags(dev, idx) =
 		    IORESOURCE_IO | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_MEM; idx++) {
-		if (!(res->mem_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_mem_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->mem_resource[idx].start = 0;
-		res->mem_resource[idx].end = 0;
-		res->mem_resource[idx].flags =
+		pnp_mem_start(dev, idx) = 0;
+		pnp_mem_end(dev, idx) = 0;
+		pnp_mem_flags(dev, idx) =
 		    IORESOURCE_MEM | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 }
@@ -290,7 +290,7 @@ static int pnp_assign_resources(struct p
 		return -ENODEV;
 
 	down(&pnp_res_mutex);
-	pnp_clean_resource_table(&dev->res);	/* start with a fresh slate */
+	pnp_clean_resource_table(dev);	/* start with a fresh slate */
 	if (dev->independent) {
 		port = dev->independent->port;
 		mem = dev->independent->mem;
@@ -362,7 +362,7 @@ static int pnp_assign_resources(struct p
 	return 1;
 
 fail:
-	pnp_clean_resource_table(&dev->res);
+	pnp_clean_resource_table(dev);
 	up(&pnp_res_mutex);
 	return 0;
 }
@@ -546,7 +546,7 @@ int pnp_disable_dev(struct pnp_dev *dev)
 
 	/* release the resources so that other devices can use them */
 	down(&pnp_res_mutex);
-	pnp_clean_resource_table(&dev->res);
+	pnp_clean_resource_table(dev);
 	up(&pnp_res_mutex);
 
 	return 0;


-
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