Skip to contentSkip to conversation

pci-meson covery issue #1442509

DISCUSSION Bjorn Helgaas 1 participant 1 message Oct 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Yue,

Please take a look at this issue reported by Coverity:

340 static int meson_pcie_link_up(struct dw_pcie *pci) 341 {

342        struct meson_pcie *mp = to_meson_pcie(pci);
343        struct device *dev = pci->dev;
344        u32 speed_okay = 0;
345        u32 cnt = 0;
346        u32 state12, state17, smlh_up, ltssm_up, rdlh_up;
347
348        do {
349                state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12);
350                state17 = meson_cfg_readl(mp, PCIE_CFG_STATUS17);
351                smlh_up = IS_SMLH_LINK_UP(state12);
352                rdlh_up = IS_RDLH_LINK_UP(state12);
353                ltssm_up = IS_LTSSM_UP(state12);

354

CID 1442509 (#1 of 1): Operands don't affect result (CONSTANT_EXPRESSION_RESULT) result_independent_of_operands: ((state17

Quoted 1 line
Quoted 1 line

7) & 1) < PCIE_GEN3 is always true regardless of the values of its

operands. This occurs as the logical operand of if.

355 if (PM_CURRENT_STATE(state17) < PCIE_GEN3)
356 speed_okay = 1;

"PM" seems like a funny name for a link speed. It sounds more like something related to power management, e.g., D0, D3.

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic