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: <20061029134003.GC10295@localhost>
Date:	Sun, 29 Oct 2006 22:40:03 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Christoph Hellwig <hch@...radead.org>,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	Len Brown <len.brown@...el.com>
Subject: [PATCH -mm] acpi: use list.h API for sub_driver list

On Sat, Oct 28, 2006 at 08:02:54PM +0100, Christoph Hellwig wrote:
> Any chance to just switch the driver to use the list.h APIs instead
> of opencoding lists?

Subject: [PATCH -mm] acpi: use list.h API for sub_driver list

Use the list.h APIs instead of opencoding lists.

Cc: Len Brown <len.brown@...el.com>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>

Index: work-fault-inject/drivers/acpi/pci_root.c
===================================================================
--- work-fault-inject.orig/drivers/acpi/pci_root.c
+++ work-fault-inject/drivers/acpi/pci_root.c
@@ -65,17 +65,14 @@ struct acpi_pci_root {
 
 static LIST_HEAD(acpi_pci_roots);
 
-static struct acpi_pci_driver *sub_driver;
+static LIST_HEAD(sub_driver);
 
 int acpi_pci_register_driver(struct acpi_pci_driver *driver)
 {
 	int n = 0;
 	struct list_head *entry;
 
-	struct acpi_pci_driver **pptr = &sub_driver;
-	while (*pptr)
-		pptr = &(*pptr)->next;
-	*pptr = driver;
+	list_add_tail(&driver->list, &sub_driver);
 
 	if (!driver->add)
 		return 0;
@@ -96,14 +93,7 @@ void acpi_pci_unregister_driver(struct a
 {
 	struct list_head *entry;
 
-	struct acpi_pci_driver **pptr = &sub_driver;
-	while (*pptr) {
-		if (*pptr == driver)
-			break;
-		pptr = &(*pptr)->next;
-	}
-	BUG_ON(!*pptr);
-	*pptr = (*pptr)->next;
+	list_del(&driver->list);
 
 	if (!driver->remove)
 		return;
Index: work-fault-inject/include/linux/acpi.h
===================================================================
--- work-fault-inject.orig/include/linux/acpi.h
+++ work-fault-inject/include/linux/acpi.h
@@ -480,7 +480,7 @@ void acpi_penalize_isa_irq(int irq, int 
 void acpi_pci_irq_disable (struct pci_dev *dev);
 
 struct acpi_pci_driver {
-	struct acpi_pci_driver *next;
+	struct list_head list;
 	int (*add)(acpi_handle handle);
 	void (*remove)(acpi_handle handle);
 };
-
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