[coreboot-gerrit] Change in coreboot[master]: device/device_simple: Warn about dev_find_slot()

Nico Huber (Code Review) gerrit at coreboot.org
Tue May 15 14:22:49 CEST 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/26291


Change subject: device/device_simple: Warn about dev_find_slot()
......................................................................

device/device_simple: Warn about dev_find_slot()

Using the secondary bus number to identify devices in the static device-
tree is unreliable as they are all zero. Alas, dev_find_slot() is used
a lot in early device code at the moment. So warn users of this imple-
mentation.

Change-Id: I312d3506fc2d6ce8cc28cf9557b21d1c1cbd2d12
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M src/device/device_simple.c
1 file changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/26291/1

diff --git a/src/device/device_simple.c b/src/device/device_simple.c
index 4a5faf6..e6a6e8f 100644
--- a/src/device/device_simple.c
+++ b/src/device/device_simple.c
@@ -18,6 +18,7 @@
  * GNU General Public License for more details.
  */
 
+#include <console/console.h>
 #include <device/device.h>
 #include <device/path.h>
 #include <device/pci.h>
@@ -38,6 +39,12 @@
 {
 	DEVTREE_CONST struct device *dev, *result;
 
+	printk(BIOS_WARNING,
+		"WARNING: Using the simple device version of %s() "
+		"is considered\ndangerous. Secondary bus numbers are not "
+		"available, yet. Please update the\n code of your platform.\n",
+		__func__);
+
 	result = 0;
 	for (dev = all_devices; dev; dev = dev->next) {
 		if ((dev->path.type == DEVICE_PATH_PCI) &&

-- 
To view, visit https://review.coreboot.org/26291
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I312d3506fc2d6ce8cc28cf9557b21d1c1cbd2d12
Gerrit-Change-Number: 26291
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180515/2034ecc3/attachment-0001.html>


More information about the coreboot-gerrit mailing list