linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>, Ryder Lee <ryder.lee@mediatek.com>
Cc: linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Frank Wunderlich <frank-w@public-files.de>
Subject: Re: pcie-mediatek.c coverity issue #1437218
Date: Fri, 27 Nov 2020 10:11:42 +0100	[thread overview]
Message-ID: <6620a6fa-0c0e-ecb5-5a2b-a50c147e9c73@gmail.com> (raw)
In-Reply-To: <20201027161911.GA182976@bjorn-Precision-5520>

Hi Ryder,

On 27/10/2020 17:19, Bjorn Helgaas wrote:
> 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);
> 

AFAIK pcie is working. Could you have a look on this code snippet? It seems as 
if there is something fishy.

Thanks,
Matthias

      reply	other threads:[~2020-11-27  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 16:19 pcie-mediatek.c coverity issue #1437218 Bjorn Helgaas
2020-11-27  9:11 ` Matthias Brugger [this message]

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=6620a6fa-0c0e-ecb5-5a2b-a50c147e9c73@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=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).