From: Bjorn Helgaas <helgaas@kernel.org>
To: Ryder Lee <ryder.lee@mediatek.com>
Cc: linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: pcie-mediatek.c coverity issue #1437218
Date: Tue, 27 Oct 2020 11:19:11 -0500 [thread overview]
Message-ID: <20201027161911.GA182976@bjorn-Precision-5520> (raw)
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);
next reply other threads:[~2020-10-27 16:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 16:19 Bjorn Helgaas [this message]
2020-11-27 9:11 ` pcie-mediatek.c coverity issue #1437218 Matthias Brugger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201027161911.GA182976@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=ryder.lee@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).