linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pci-meson covery issue #1442509
@ 2020-10-27 16:40 Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2020-10-27 16:40 UTC (permalink / raw)
  To: Yue Wang; +Cc: linux-pci, Kevin Hilman, linux-amlogic

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
>> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-29  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2020102810175892085918@amlogic.com>
2020-10-28 12:06 ` pci-meson covery issue #1442509 Bjorn Helgaas
2020-10-27 16:40 Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).