From patchwork Mon Apr 22 23:11:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 238683 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 48CEC2C0169 for ; Tue, 23 Apr 2013 09:11:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840Ab3DVXLQ (ORCPT ); Mon, 22 Apr 2013 19:11:16 -0400 Received: from mail-ia0-f173.google.com ([209.85.210.173]:34868 "EHLO mail-ia0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753742Ab3DVXLQ (ORCPT ); Mon, 22 Apr 2013 19:11:16 -0400 Received: by mail-ia0-f173.google.com with SMTP id j5so8991iaf.32 for ; Mon, 22 Apr 2013 16:11:15 -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=vpshLv8dsPdPQ6YCmqfNDxy77OkuV+PXJXyeyiEqnik=; b=RTrHVhXQXDD2/rWmr455eGq1Yia/ZT53C/Lt2umTKedoZxLdRjiY6zVMR03Jvik98m zqF8FtOoD1cGj7xyNGaEcM17tNpaiUpjlSKaeH6Jrsa7JOANMUvqqeg3oHEcMPosFbbP 0Oni8O21j8vpqWHhiDMH4IL92uTnTjftJ14Vrrw0N9Yn9c+tjoTvnI27WIctDKDc3nLA FS3dWOCD6ae9MOIucWUdnG/Q97c0Xy/X+GeVFUYTh8vjqqn4bVYJ0Vo+ejY9Qce5EIjA apHLFVi6i3vh6qrTGH8fX18IjR6gi8zhRYLcrG3TLeMd97Uw6fWrPSlg3g6JQUtKFnrr QIKw== 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=vpshLv8dsPdPQ6YCmqfNDxy77OkuV+PXJXyeyiEqnik=; b=Fd6gC+USeKMr5cgbRX0xxOAiyxCWEvuU3i6gE+yNyMWnGTcSy+FlD6M2Lq/qUPdmz9 59rnpIKHt/UWJTh8RN3M8eG6SnvQ1c9if5JdUwacmPuwPq7kWUOAK5w2mvSUNgeNEoQN Xw3ZzhQChwXMlEL4fWHy3xbq3dTLHBAcG0ykZRma8j6KLysvtj7OlQcK6WverEGsRk4i IbqCsQj+JbuNuRcKF9zE8h7A8qSOrkqx90fpsAaindizJBzqHZI0D4QjPHLKnjaWQYUv ZOg1tXGqbatMW7vPyUTBLDVjzZKNOjXQ5Mp9krm6FEFlRBYpNFRgj7a+2UUAWIcbmZ3m tYLg== X-Received: by 10.50.62.66 with SMTP id w2mr8949598igr.81.1366672275653; Mon, 22 Apr 2013 16:11:15 -0700 (PDT) Received: from localhost ([172.29.120.215]) by mx.google.com with ESMTPS id hi4sm19684910igc.6.2013.04.22.16.11.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 16:11:15 -0700 (PDT) Subject: [PATCH v4 09/22] PCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Gavin Shan Date: Mon, 22 Apr 2013 17:11:14 -0600 Message-ID: <20130422231113.32621.60385.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: ALoCoQnzIez+pMf/FE0wDXCTDYUj7vXGqCk9hbQmg3E0rdqeYXjwV0dRYhaxAmaFuAoBwR117QFjIIGZJt3Xb97fHaFMZpaIwhAlxy9q5bt4Pn1pJTZTROnXBIO3rhLLaqieJ53TXtnNLd6niHjj810yoUjhdxXJSdZesmktBpKPQzZi0wAubQGfc+Rgt8lQV6kTDLmD/7I1Slmzm4qwrkpH4I8bp+TxkQS70gUoHwrtkob/v0JRtbo= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Note the error in pci_msix_table_size() -- we used PCI_MSI_FLAGS to locate the PCI_MSIX_FLAGS word. No actual breakage because PCI_MSI_FLAGS and PCI_MSIX_FLAGS happen to be the same. Signed-off-by: Bjorn Helgaas --- drivers/pci/msi.c | 8 ++++---- drivers/pci/msi.h | 1 - 2 files changed, 4 insertions(+), 5 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 631249e..b1a60e0 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -299,10 +299,10 @@ void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg) int pos = dev->msi_cap; u16 msgctl; - pci_read_config_word(dev, msi_control_reg(pos), &msgctl); + pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &msgctl); msgctl &= ~PCI_MSI_FLAGS_QSIZE; msgctl |= entry->msi_attrib.multiple << 4; - pci_write_config_word(dev, msi_control_reg(pos), msgctl); + pci_write_config_word(dev, pos + PCI_MSI_FLAGS, msgctl); pci_write_config_dword(dev, msi_lower_address_reg(pos), msg->address_lo); @@ -548,7 +548,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec) msi_set_enable(dev, 0); /* Disable MSI during set up */ - pci_read_config_word(dev, msi_control_reg(dev->msi_cap), &control); + pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); /* MSI Entry Initialization */ entry = alloc_msi_entry(dev); if (!entry) @@ -903,7 +903,7 @@ int pci_msix_table_size(struct pci_dev *dev) if (!dev->msix_cap) return 0; - pci_read_config_word(dev, msi_control_reg(dev->msix_cap), &control); + pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &control); return multi_msix_capable(control); } diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h index 65c42f8..6aa7b19 100644 --- a/drivers/pci/msi.h +++ b/drivers/pci/msi.h @@ -6,7 +6,6 @@ #ifndef MSI_H #define MSI_H -#define msi_control_reg(base) (base + PCI_MSI_FLAGS) #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) #define msi_data_reg(base, is64bit) \