summaryrefslogtreecommitdiff
path: root/ls-ecaps.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-12-26 22:11:51 +0100
committerMartin Mares <mj@ucw.cz>2022-02-10 12:58:17 +0100
commit6811edb82791b1cc18889062a226522b7cdd74a8 (patch)
tree7a3227c143234203a4b330b778651465bca05cd7 /ls-ecaps.c
parentb5bbc1adb18bffb03f76d933ac4ab971e04e385b (diff)
downloadpciutils-6811edb82791b1cc18889062a226522b7cdd74a8.tar.gz
lspci: Replace unsigned long long type by u64 and %llx format by PCI_U64_FMT_X
pciutils already provides and uses u64 type together with PCI_U64_FMT_X format macro for printing hex value of this type. So use u64 and PCI_U64_FMT_X also on other few remaining places. This change fixes printing hexadecimal 64-bit numbers by lspci on Window systems independently of used compiler (MinGW or MSVC).
Diffstat (limited to 'ls-ecaps.c')
-rw-r--r--ls-ecaps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ls-ecaps.c b/ls-ecaps.c
index 1cea315..bd29c99 100644
--- a/ls-ecaps.c
+++ b/ls-ecaps.c
@@ -68,12 +68,12 @@ cap_ltr(struct device *d, int where)
snoop = get_conf_word(d, where + PCI_LTR_MAX_SNOOP);
scale = cap_ltr_scale((snoop >> PCI_LTR_SCALE_SHIFT) & PCI_LTR_SCALE_MASK);
printf("\t\tMax snoop latency: %lldns\n",
- ((unsigned long long)snoop & PCI_LTR_VALUE_MASK) * scale);
+ ((u64)snoop & PCI_LTR_VALUE_MASK) * scale);
nosnoop = get_conf_word(d, where + PCI_LTR_MAX_NOSNOOP);
scale = cap_ltr_scale((nosnoop >> PCI_LTR_SCALE_SHIFT) & PCI_LTR_SCALE_MASK);
printf("\t\tMax no snoop latency: %lldns\n",
- ((unsigned long long)nosnoop & PCI_LTR_VALUE_MASK) * scale);
+ ((u64)nosnoop & PCI_LTR_VALUE_MASK) * scale);
}
static void
@@ -826,7 +826,7 @@ cap_l1pm(struct device *d, int where)
if (scale > 5)
printf(" LTR1.2_Threshold=<error>");
else
- printf(" LTR1.2_Threshold=%lldns", BITS(val, 16, 10) * (unsigned long long) cap_ltr_scale(scale));
+ printf(" LTR1.2_Threshold=%lldns", BITS(val, 16, 10) * (u64) cap_ltr_scale(scale));
}
printf("\n");
}