From patchwork Tue Jan 30 10:34:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Pimentel X-Patchwork-Id: 10191671 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3736B60388 for ; Tue, 30 Jan 2018 10:34:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27AEA2899C for ; Tue, 30 Jan 2018 10:34:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C934289A9; Tue, 30 Jan 2018 10:34:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFB22899C for ; Tue, 30 Jan 2018 10:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbeA3KeS (ORCPT ); Tue, 30 Jan 2018 05:34:18 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:60362 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbeA3KeS (ORCPT ); Tue, 30 Jan 2018 05:34:18 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id AC63F24E15BB; Tue, 30 Jan 2018 02:34:17 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 4E389F0C; Tue, 30 Jan 2018 02:34:17 -0800 (PST) Received: from pt02.synopsys.com (pt02.internal.synopsys.com [10.107.23.240]) by mailhost.synopsys.com (Postfix) with ESMTP id 19644F0B; Tue, 30 Jan 2018 02:34:16 -0800 (PST) Received: from UbuntuMate-64Bits.internal.synopsys.com (gustavo-e7480.internal.synopsys.com [10.107.25.102]) by pt02.synopsys.com (Postfix) with ESMTP id F3A749B8B; Tue, 30 Jan 2018 10:34:15 +0000 (WET) From: Gustavo Pimentel To: linux-pci@vger.kernel.org Cc: mj@ucw.cz, Gustavo Pimentel Subject: [PATCH] Fix Vector table and PBA addresses print output Date: Tue, 30 Jan 2018 10:34:08 +0000 Message-Id: <998ca55d1a2b9a7f6912dcff69bc57d31b690fb0.1517308416.git.gustavo.pimentel@synopsys.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Lack of 3-bit rotation to the right was leading to erroneous display of the vector table and PBA. Signed-off-by: Gustavo Pimentel --- ls-caps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ls-caps.c b/ls-caps.c index 507771a..cd13a37 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -1104,10 +1104,10 @@ cap_msix(struct device *d, int where, int cap) off = get_conf_long(d, where + PCI_MSIX_TABLE); printf("\t\tVector table: BAR=%d offset=%08x\n", - off & PCI_MSIX_BIR, off & ~PCI_MSIX_BIR); + off & PCI_MSIX_BIR, (off & ~PCI_MSIX_BIR) >> 3); off = get_conf_long(d, where + PCI_MSIX_PBA); printf("\t\tPBA: BAR=%d offset=%08x\n", - off & PCI_MSIX_BIR, off & ~PCI_MSIX_BIR); + off & PCI_MSIX_BIR, (off & ~PCI_MSIX_BIR) >> 3); } static void