Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: linux-pci@vger.kernel.org
Subject: pcie-rockchip-ep.c coverity issue #1437163
Date: Tue, 27 Oct 2020 11:16:36 -0500
Message-ID: <20201027161636.GA182618@bjorn-Precision-5520> (raw)

Hi Shawn,

Please take a look at this issue reported by Coverity:

332 static int rockchip_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
333 {
334        struct rockchip_pcie_ep *ep = epc_get_drvdata(epc);
335        struct rockchip_pcie *rockchip = &ep->rockchip;
336        u16 flags;
337
338        flags = rockchip_pcie_read(rockchip,
339                                   ROCKCHIP_PCIE_EP_FUNC_BASE(fn) +
340                                   ROCKCHIP_PCIE_EP_MSI_CTRL_REG);

CID 1437163 (#2 of 2): Operands don't affect result
(CONSTANT_EXPRESSION_RESULT) result_independent_of_operands: flags &
(65536UL /* 1UL << 16 */) is always 0 regardless of the values of its
operands. This occurs as the logical operand of !.

341        if (!(flags & ROCKCHIP_PCIE_EP_MSI_CTRL_ME))
342                return -EINVAL;

             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 16:16 Bjorn Helgaas [this message]
2020-10-27 16:37 ` Bjorn Helgaas
     [not found] <60a290a9-678b-b08d-25b4-8299f2f2c916@rock-chips.com>
2020-12-23 21:04 ` Bjorn Helgaas
2020-12-24  0:55   ` Shawn Lin

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=20201027161636.GA182618@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=shawn.lin@rock-chips.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

Linux-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git