linux/drivers/pci/pcie
Gustavo A. R. Silva f51af8a63c PCI/ASPM: Declare threshold_ns as u32, not u64
aspm_calc_l1ss_info() computes l1_2_threshold in microseconds as:

  l1_2_threshold = 2 + 4 + t_common_mode + t_power_on;

where t_common_mode is at most 255us:

  PCI_L1SS_CAP_CM_RESTORE_TIME  0x0000ff00   <-- 8 bits; <256us

and t_power_on is at most 31 * 100us = 3100us:

  PCI_L1SS_CAP_P_PWR_ON_VALUE   0x00f80000   <-- 5 bits; <32
  PCI_L1SS_CAP_P_PWR_ON_SCALE   0x00030000   <-- *2us, *10us, or *100us

So l1_2_threshold is at most 2 + 4 + 255 + 3100 = 3361, which means
threshold_ns is at most 3361 * 1000 = 3361000, which easily fits in a
u32.

Declare threshold_ns as u32, not u64.  This fixes a Coverity warning.

Addresses-Coverity-ID: 1462501
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
2018-02-28 14:39:53 -06:00
..
aer pci-v4.16-changes 2018-02-06 09:59:40 -08:00
Kconfig Merge branch 'pci/spdx' into next 2018-02-01 11:40:07 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
aspm.c PCI/ASPM: Declare threshold_ns as u32, not u64 2018-02-28 14:39:53 -06:00
pcie-dpc.c Merge branch 'pci/spdx' into next 2018-02-01 11:40:07 -06:00
pme.c Merge branch 'pci/spdx' into next 2018-02-01 11:40:07 -06:00
portdrv.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
portdrv_acpi.c PCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate 2018-01-28 15:48:29 -06:00
portdrv_bus.c PCI: Add SPDX GPL-2.0 when no license was specified 2018-01-26 11:45:16 -06:00
portdrv_core.c PCI/DPC: Enable DPC only if AER is available 2018-01-26 16:49:40 -06:00
portdrv_pci.c PCI / PM: Use SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports 2018-01-09 13:09:17 +01:00
ptm.c Merge branch 'pci/spdx' into next 2018-02-01 11:40:07 -06:00