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: <1490256755-889-2-git-send-email-jeffy.chen@rock-chips.com>
Date:   Thu, 23 Mar 2017 16:12:34 +0800
From:   Jeffy Chen <jeffy.chen@...k-chips.com>
To:     linux-kernel@...r.kernel.org
Cc:     robh@...nel.org, toshi.kani@....com, shawn.lin@...k-chips.com,
        briannorris@...omium.org, dianders@...omium.org,
        bhelgaas@...gle.com, dtor@...omium.org,
        Jeffy Chen <jeffy.chen@...k-chips.com>,
        linux-pci@...r.kernel.org
Subject: [PATCH v2 1/2] PCI: return resource_entry in pci_add_resource helpers

Signed-off-by: Jeffy Chen <jeffy.chen@...k-chips.com>
---

Changes in v2: None

 drivers/pci/bus.c   | 13 ++++++++-----
 include/linux/pci.h |  8 +++++---
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index bc56cf1..36a1861 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -17,25 +17,28 @@
 
 #include "pci.h"
 
-void pci_add_resource_offset(struct list_head *resources, struct resource *res,
-			     resource_size_t offset)
+struct resource_entry *pci_add_resource_offset(struct list_head *resources,
+					       struct resource *res,
+					       resource_size_t offset)
 {
 	struct resource_entry *entry;
 
 	entry = resource_list_create_entry(res, 0);
 	if (!entry) {
 		printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res);
-		return;
+		return NULL;
 	}
 
 	entry->offset = offset;
 	resource_list_add_tail(entry, resources);
+	return entry;
 }
 EXPORT_SYMBOL(pci_add_resource_offset);
 
-void pci_add_resource(struct list_head *resources, struct resource *res)
+struct resource_entry *pci_add_resource(struct list_head *resources,
+					struct resource *res)
 {
-	pci_add_resource_offset(resources, res, 0);
+	return pci_add_resource_offset(resources, res, 0);
 }
 EXPORT_SYMBOL(pci_add_resource);
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index eb3da1a..ab16abe 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1167,9 +1167,11 @@ void pci_release_selected_regions(struct pci_dev *, int);
 /* drivers/pci/bus.c */
 struct pci_bus *pci_bus_get(struct pci_bus *bus);
 void pci_bus_put(struct pci_bus *bus);
-void pci_add_resource(struct list_head *resources, struct resource *res);
-void pci_add_resource_offset(struct list_head *resources, struct resource *res,
-			     resource_size_t offset);
+struct resource_entry *pci_add_resource(struct list_head *resources,
+					struct resource *res);
+struct resource_entry *pci_add_resource_offset(struct list_head *resources,
+					       struct resource *res,
+					       resource_size_t offset);
 void pci_free_resource_list(struct list_head *resources);
 void pci_bus_add_resource(struct pci_bus *bus, struct resource *res,
 			  unsigned int flags);
-- 
2.1.4


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ