All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Support region sizes that are not power-of-2 in lspci
@ 2016-01-13 19:47 Sean O. Stalley
  0 siblings, 0 replies; only message in thread
From: Sean O. Stalley @ 2016-01-13 19:47 UTC (permalink / raw)
  To: linux-pci, mj; +Cc: sean.stalley, bhelgaas, david.daney

Enhanced Allocation allows PCI devices to reserve regions with DWORD
granularity. Make sure lspci doesn't tuncate least significant bits
of the region size.

ex: a 2000 byte region should display [size=2000] instead of [size=1K]
Signed-off-by: Sean O. Stalley <sean.stalley@intel.com>
---
 lspci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lspci.c b/lspci.c
index fe7b7fe..d483f3a 100644
--- a/lspci.c
+++ b/lspci.c
@@ -336,7 +336,7 @@ show_size(pciaddr_t x)
   if (!x)
     return;
   for (i = 0; i < (sizeof(suffix) / sizeof(*suffix) - 1); i++) {
-    if (x < 1024)
+    if (x % 1024)
       break;
     x /= 1024;
   }
@@ -366,7 +366,7 @@ show_bases(struct device *d, int cnt)
 	putchar('\t');
       if (pos && !flg)			/* Reported by the OS, but not by the device */
 	{
-	  printf("[virtual] ");
+	  printf("[virtual] ");		/* could also be enhanced */
 	  flg = pos;
 	  virtual = 1;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-13 19:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 19:47 [PATCH 1/1] Support region sizes that are not power-of-2 in lspci Sean O. Stalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.