diff mbox

lspci tries to open non-existent files

Message ID 20090630123804.GV5480@parisc-linux.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Matthew Wilcox June 30, 2009, 12:38 p.m. UTC
On Tue, Jun 30, 2009 at 06:23:43AM -0600, Matthew Wilcox wrote:
> I'd be inclined to make lspci error out when trying -M with sysfs or procfs.

... here's the patch to do that:

----

Add sysfs to the list of access methods that don't work with -M.

Change the warning to an error; there's no point in proceeding.

Comments

Martin Mareš June 30, 2009, 12:39 p.m. UTC | #1
Hi!

> Change the warning to an error; there's no point in proceeding.

Well, I have used it when debugging the bus mapper several times, so I would
prefer keeping it as a warning. The addition of PCI_ACCESS_SYS_BUS_PCI is
of course correct.

				Have a nice fortnight
diff mbox

Patch

diff --git a/ls-map.c b/ls-map.c
index c812f50..150aeb9 100644
--- a/ls-map.c
+++ b/ls-map.c
@@ -164,8 +164,9 @@  void
 map_the_bus(void)
 {
   if (pacc->method == PCI_ACCESS_PROC_BUS_PCI ||
+      pacc->method == PCI_ACCESS_SYS_BUS_PCI ||
       pacc->method == PCI_ACCESS_DUMP)
-    printf("WARNING: Bus mapping can be reliable only with direct hardware access enabled.\n\n");
+    pacc->error("Bus mapping only works with direct hardware access");
   bus_info = xmalloc(sizeof(struct bus_info) * 256);
   memset(bus_info, 0, sizeof(struct bus_info) * 256);
   if (filter.bus >= 0)