linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pcie-mediatek.c coverity issue #1437218
@ 2020-10-27 16:19 Bjorn Helgaas
  2020-11-27  9:11 ` Matthias Brugger
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2020-10-27 16:19 UTC (permalink / raw)
  To: Ryder Lee; +Cc: linux-pci, linux-mediatek

Hi Ryder,

Please take a look at this issue reported by Coverity:

 760 static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
 761 {
 762        struct mtk_pcie *pcie = port->pcie;

CID 1437218 (#1 of 1): Wrong operator used
(CONSTANT_EXPRESSION_RESULT) operator_confusion: (port->slot << 3) & 7
is always 0 regardless of the values of its operands. This occurs as
an initializer.

    	Did you intend to use right-shift (>>) in port->slot << 3?

 763        u32 func = PCI_FUNC(port->slot << 3);
 764        u32 slot = PCI_SLOT(port->slot << 3);

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

end of thread, other threads:[~2020-11-27  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 16:19 pcie-mediatek.c coverity issue #1437218 Bjorn Helgaas
2020-11-27  9:11 ` Matthias Brugger

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