From patchwork Mon Apr 22 23:11:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 238687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D97BF2C014B for ; Tue, 23 Apr 2013 09:11:43 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753778Ab3DVXLn (ORCPT ); Mon, 22 Apr 2013 19:11:43 -0400 Received: from mail-ia0-f173.google.com ([209.85.210.173]:54459 "EHLO mail-ia0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752616Ab3DVXLm (ORCPT ); Mon, 22 Apr 2013 19:11:42 -0400 Received: by mail-ia0-f173.google.com with SMTP id j5so9280iaf.32 for ; Mon, 22 Apr 2013 16:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=GPtpxB1y5iZz/GCL4xdme9fz38qTu1xXmJpAblx6eso=; b=GutGsKdboKohhyfUGT3dFe2ipCf87y85mZ16NPOFzPbwI52JjiL/Lc+1hE6zzQSDGJ +Nsv6cuyjvvGbb32pGkv3pLW9M+SnrcIIOFaUTtyAyr/GwXrO7vT3R/c0C2cwI+SkeDU SWELKJnZNpLHsnKqmkhdmi3uBSQtT0CwxiQV36OQpeO/E5N+WFMOUe7h7hhuHjut0P/R P99qqiLdW1ulFxtetvSAzfj8UVv9l83A2izrMP8ghHdF/2Ui+Qr/UOvbdHG8LG4SOk2o te8AeKNBNTLPsA6INQpVdq7R/ddVKTH9edihS4mdZy+n+Q+SZGaisYmQVmCHtThbBXY2 zD4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=GPtpxB1y5iZz/GCL4xdme9fz38qTu1xXmJpAblx6eso=; b=cpj89gJyiXf4GQZaEQk5VM7K+TIzA1bHgaMw3bQgoAEAIFLCiwsNAqL3oadIq5/9N/ DRNXbTLbWu8QYfXm/iw7l956GU//rwQNr+LH1flJscssWHunO6JEbXyDOMQ8dFzT3ep3 1rlKbXNL8y4ONLSA2nkjZ2dUK463mv9FU8KLVVByOBSV4qt2WhN4ro6m0609Q3mp4qvF L9RKGfgdB7Jq3cjcnOBPijZHMDUQtLjHeJLqZxJdEqKjXdLpmjWGLIuodhlh4ba73Muc hanYoOdihnjpp6gqRvCoqzId+UFD2zLKNATIHhPXGQDSorTLEI4MW7eoDje5hXr1w+nv N5vA== X-Received: by 10.50.50.162 with SMTP id d2mr12313279igo.76.1366672302450; Mon, 22 Apr 2013 16:11:42 -0700 (PDT) Received: from localhost ([172.29.120.215]) by mx.google.com with ESMTPS id fl5sm18026625igb.9.2013.04.22.16.11.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 16:11:42 -0700 (PDT) Subject: [PATCH v4 13/22] PCI: Drop msix_table_offset_reg() and msix_pba_offset_reg() macros To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Gavin Shan Date: Mon, 22 Apr 2013 17:11:40 -0600 Message-ID: <20130422231140.32621.27788.stgit@bhelgaas-glaptop> In-Reply-To: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> References: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmEBNG+ubFo1GAOf/3q+42ORUwytsKbSmRhBOMNHjDs2M2lIelJNhCkCJcpNGyw1tX6xqk2NImEQ6sndojBB6rFMa0Xlap0r84HfPPmC0sW2xEZ76wYpLRv6O1O2G5BkRFfNHYQil2AhoPZosn8XDamnwzQlpEB5hLVWGtXLR49Yx+MZr9ffxJ4AepTbZUDnUWcY+kXwP6CLWhGk0hvOmbxGfCoGGEzFmMhwhvDiIAQhI8KhUQ= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org msix_table_offset_reg() is used only once and adds a useless indirection, so just use the table offset directly. msix_pba_offset_reg() is unused, so just delete it. Signed-off-by: Bjorn Helgaas --- drivers/pci/msi.c | 4 ++-- drivers/pci/msi.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index aaaf954..fb07e05 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -600,8 +600,8 @@ static void __iomem *msix_map_region(struct pci_dev *dev, unsigned nr_entries) u32 table_offset; u8 bir; - pci_read_config_dword(dev, - msix_table_offset_reg(dev->msix_cap), &table_offset); + pci_read_config_dword(dev, dev->msix_cap + PCI_MSIX_TABLE, + &table_offset); bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK); table_offset &= ~PCI_MSIX_FLAGS_BIRMASK; phys_addr = pci_resource_start(dev, bir) + table_offset; diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h index bc5cd99..d76c7b2 100644 --- a/drivers/pci/msi.h +++ b/drivers/pci/msi.h @@ -9,8 +9,6 @@ #define msi_mask_reg(base, is64bit) \ (base + ((is64bit == 1) ? PCI_MSI_MASK_64 : PCI_MSI_MASK_32)) -#define msix_table_offset_reg(base) (base + PCI_MSIX_TABLE) -#define msix_pba_offset_reg(base) (base + PCI_MSIX_PBA) #define msix_table_size(control) ((control & PCI_MSIX_FLAGS_QSIZE)+1) #define multi_msix_capable(control) msix_table_size((control))