]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
lspci: Fix wrong read size for RootSta
authorJeffy Chen <jeffy.chen@rock-chips.com>
Fri, 30 Jun 2017 10:09:00 +0000 (18:09 +0800)
committerMartin Mares <mj@ucw.cz>
Wed, 5 Jul 2017 13:14:23 +0000 (15:14 +0200)
We are reading wrong size(word) for this cap, since:

RootSta has:
PCI_EXP_RTSTA_PME_STATUS  0x00010000 /* PME Status */
PCI_EXP_RTSTA_PME_PENDING 0x00020000 /* PME is Pending */

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
ls-caps.c

index 0ca46fb3db688b0dd41da4a1aacf9f1154fd341d..d4aebc8e80753d9319923fbf8d25fd5c8e2e3e8f 100644 (file)
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -879,7 +879,7 @@ static void cap_express_root(struct device *d, int where)
   printf("\t\tRootCap: CRSVisible%c\n",
        FLAG(w, PCI_EXP_RTCAP_CRSVIS));
 
-  w = get_conf_word(d, where + PCI_EXP_RTSTA);
+  w = get_conf_long(d, where + PCI_EXP_RTSTA);
   printf("\t\tRootSta: PME ReqID %04x, PMEStatus%c PMEPending%c\n",
        w & PCI_EXP_RTSTA_PME_REQID,
        FLAG(w, PCI_EXP_RTSTA_PME_STATUS),