From patchwork Tue Oct 27 16:51:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 11860905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA678921 for ; Tue, 27 Oct 2020 16:52:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A8402224A for ; Tue, 27 Oct 2020 16:52:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="MfAM/CSQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1813570AbgJ0QwB (ORCPT ); Tue, 27 Oct 2020 12:52:01 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:38302 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1813584AbgJ0QwA (ORCPT ); Tue, 27 Oct 2020 12:52:00 -0400 X-UUID: 303739ed48c74eee8c36ddd921644957-20201028 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=U7XynagizbrPxo62KttFyy3xZCzKkCXP4tL+OC/Qsws=; b=MfAM/CSQ6SiWwRphiqmGCn7qL8XVuK7B11Djfb8lb+cv5qCDCI3Purc8b9KqgufEWZDLJ0jqM36v8CxoIKHb3BqxQzF24Wu9UyYjV8PaY58u1YJ+TZLJQgeVWnNi6Qfd2a/eWAGn9ytyJhn7MsmBs3OCYbwzSEA2Fe/6jM3Oqq8=; X-UUID: 303739ed48c74eee8c36ddd921644957-20201028 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1890579906; Wed, 28 Oct 2020 00:51:52 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 28 Oct 2020 00:51:49 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 28 Oct 2020 00:51:49 +0800 From: Ryder Lee To: Bjorn Helgaas CC: , , Ryder Lee Subject: [PATCH] pci: mediatek: fix wrong operator used Date: Wed, 28 Oct 2020 00:51:48 +0800 Message-ID: <2418edb8c8c81bc646ce9c508939dc27e848dcd7.1603817008.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: BA7EE0B2AC46DCA966E61E9FE1D7ED14540C86DBFE74E0B1D2CF6F77BF31C2952000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Fix the issue reported by Coverity: 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. Signed-off-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index cf4c18f0c25a..1980b01cee35 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -760,7 +760,7 @@ static struct pci_ops mtk_pcie_ops = { static int mtk_pcie_startup_port(struct mtk_pcie_port *port) { struct mtk_pcie *pcie = port->pcie; - u32 func = PCI_FUNC(port->slot << 3); + u32 func = PCI_FUNC(port->slot); u32 slot = PCI_SLOT(port->slot << 3); u32 val; int err;