linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Liu <jiang.liu@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Randy Dunlap <rdunlap@infradead.org>,
	Yinghai Lu <yinghai@kernel.org>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, Jiang Liu <jiang.liu@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Tony Luck <tony.luck@intel.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-acpi@vger.kernel.org
Subject: [Patch v2 03/14] x86, irq: Use accessor irq_data_get_node() to hide struct irq_data detail
Date: Wed, 20 May 2015 17:40:34 +0800	[thread overview]
Message-ID: <1432114845-24304-4-git-send-email-jiang.liu@linux.intel.com> (raw)
In-Reply-To: <1432114845-24304-1-git-send-email-jiang.liu@linux.intel.com>

Use accessor irq_data_get_node() to hide struct irq_data implementation
detail, so we could easily reconstruct struct irq_data later.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 arch/x86/kernel/apic/vector.c |    8 ++++----
 arch/x86/platform/uv/uv_irq.c |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 28eba2d38b15..9b62f690b0ff 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -296,7 +296,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
 	struct irq_alloc_info *info = arg;
 	struct apic_chip_data *data;
 	struct irq_data *irq_data;
-	int i, err;
+	int i, err, node;
 
 	if (disable_apic)
 		return -ENXIO;
@@ -308,12 +308,13 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
 	for (i = 0; i < nr_irqs; i++) {
 		irq_data = irq_domain_get_irq_data(domain, virq + i);
 		BUG_ON(!irq_data);
+		node = irq_data_get_node(irq_data);
 #ifdef	CONFIG_X86_IO_APIC
 		if (virq + i < nr_legacy_irqs() && legacy_irq_data[virq + i])
 			data = legacy_irq_data[virq + i];
 		else
 #endif
-			data = alloc_apic_chip_data(irq_data->node);
+			data = alloc_apic_chip_data(node);
 		if (!data) {
 			err = -ENOMEM;
 			goto error;
@@ -322,8 +323,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
 		irq_data->chip = &lapic_controller;
 		irq_data->chip_data = data;
 		irq_data->hwirq = virq + i;
-		err = assign_irq_vector_policy(virq, irq_data->node, data,
-					       info);
+		err = assign_irq_vector_policy(virq, node, data, info);
 		if (err)
 			goto error;
 	}
diff --git a/arch/x86/platform/uv/uv_irq.c b/arch/x86/platform/uv/uv_irq.c
index 8570abe68be1..e1c24631afbb 100644
--- a/arch/x86/platform/uv/uv_irq.c
+++ b/arch/x86/platform/uv/uv_irq.c
@@ -89,7 +89,7 @@ static int uv_domain_alloc(struct irq_domain *domain, unsigned int virq,
 		return -EINVAL;
 
 	chip_data = kmalloc_node(sizeof(*chip_data), GFP_KERNEL,
-				 irq_data->node);
+				 irq_data_get_node(irq_data));
 	if (!chip_data)
 		return -ENOMEM;
 
-- 
1.7.10.4


  parent reply	other threads:[~2015-05-20  9:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20  9:40 [Patch v2 00/14] Split struct irq_data into common part and per-chip part Jiang Liu
2015-05-20  9:40 ` [Patch v2 01/14] genirq: Introduce struct irq_common_data to host shared irq data Jiang Liu
2015-05-20  9:40 ` [Patch v2 02/14] genirq: Introduce helper function irq_data_get_node() Jiang Liu
2015-05-20  9:40 ` Jiang Liu [this message]
2015-05-20  9:40 ` [Patch v2 04/14] sh, irq: Use accessor irq_data_get_node() to hide struct irq_data detail Jiang Liu
2015-05-20  9:40 ` [Patch v2 05/14] genirq: Move field 'node' from struct irq_data into struct irq_common_data Jiang Liu
2015-05-20  9:40 ` [Patch v2 06/14] genirq: Move field 'handler_data' " Jiang Liu
2015-05-20 14:48   ` Thomas Gleixner
2015-05-20  9:40 ` [Patch v2 07/14] mn10300: Fix incorrect use of data->affinity Jiang Liu
2015-05-20  9:40 ` [Patch v2 09/14] net/mlx4: Cache irq_desc->affinity instead of irq_desc Jiang Liu
2015-05-20  9:40 ` [Patch v2 10/14] genirq: Move field 'affinity' from struct irq_data into struct irq_common_data Jiang Liu
2015-05-20  9:40 ` [Patch v2 11/14] genirq: Rename irq_data_get_msi() as irq_data_get_msi_desc() Jiang Liu
2015-05-20 13:08   ` Bjorn Helgaas
2015-05-20  9:40 ` [Patch v2 12/14] genirq: Use helper function to access irq_data->msi_desc Jiang Liu
2015-05-20  9:40 ` [Patch v2 13/14] genirq: Move field 'msi_desc' from struct irq_data into struct irq_common_data Jiang Liu
2015-05-20  9:40 ` [Patch v2 14/14] genirq: Pass irq_data to helper function __irq_set_chip_handler_name_locked() Jiang Liu

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=1432114845-24304-4-git-send-email-jiang.liu@linux.intel.com \
    --to=jiang.liu@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /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).