All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Jiang Liu <jiang.liu@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: [patch 4/7] x86/irq: Rename VECTOR_UNDEFINED to VECTOR_UNUSED
Date: Sun, 02 Aug 2015 20:38:25 -0000	[thread overview]
Message-ID: <20150802203609.477282494@linutronix.de> (raw)
In-Reply-To: 20150802203427.110728870@linutronix.de

[-- Attachment #1: x86-irq--Rename-VECTOR_UNDEFINED-to-VECTOR_UNUSED --]
[-- Type: text/plain, Size: 4904 bytes --]

VECTOR_UNDEFINED is a misnomer. The vector is defined, but unused.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/hw_irq.h |    2 +-
 arch/x86/kernel/apic/vector.c |   15 +++++++--------
 arch/x86/kernel/irq.c         |    8 ++++----
 arch/x86/kernel/irqinit.c     |    4 ++--
 4 files changed, 14 insertions(+), 15 deletions(-)

Index: tip/arch/x86/include/asm/hw_irq.h
===================================================================
--- tip.orig/arch/x86/include/asm/hw_irq.h
+++ tip/arch/x86/include/asm/hw_irq.h
@@ -182,7 +182,7 @@ extern char irq_entries_start[];
 #define trace_irq_entries_start irq_entries_start
 #endif
 
-#define VECTOR_UNDEFINED	(-1)
+#define VECTOR_UNUSED		(-1)
 #define VECTOR_RETRIGGERED	(-2)
 
 typedef int vector_irq_t[NR_VECTORS];
Index: tip/arch/x86/kernel/apic/vector.c
===================================================================
--- tip.orig/arch/x86/kernel/apic/vector.c
+++ tip/arch/x86/kernel/apic/vector.c
@@ -169,8 +169,7 @@ next:
 			goto next;
 
 		for_each_cpu_and(new_cpu, vector_cpumask, cpu_online_mask) {
-			if (per_cpu(vector_irq, new_cpu)[vector] >
-			    VECTOR_UNDEFINED)
+			if (per_cpu(vector_irq, new_cpu)[vector] > VECTOR_UNUSED)
 				goto next;
 		}
 		/* Found one! */
@@ -232,7 +231,7 @@ static void clear_irq_vector(int irq, st
 
 	vector = data->cfg.vector;
 	for_each_cpu_and(cpu, data->domain, cpu_online_mask)
-		per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED;
+		per_cpu(vector_irq, cpu)[vector] = VECTOR_UNUSED;
 
 	data->cfg.vector = 0;
 	cpumask_clear(data->domain);
@@ -247,7 +246,7 @@ static void clear_irq_vector(int irq, st
 		     vector++) {
 			if (per_cpu(vector_irq, cpu)[vector] != irq)
 				continue;
-			per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED;
+			per_cpu(vector_irq, cpu)[vector] = VECTOR_UNUSED;
 			break;
 		}
 	}
@@ -423,12 +422,12 @@ static void __setup_vector_irq(int cpu)
 	/* Mark the free vectors */
 	for (vector = 0; vector < NR_VECTORS; ++vector) {
 		irq = per_cpu(vector_irq, cpu)[vector];
-		if (irq <= VECTOR_UNDEFINED)
+		if (irq <= VECTOR_UNUSED)
 			continue;
 
 		data = apic_chip_data(irq_get_irq_data(irq));
 		if (!cpumask_test_cpu(cpu, data->domain))
-			per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED;
+			per_cpu(vector_irq, cpu)[vector] = VECTOR_UNUSED;
 	}
 }
 
@@ -552,7 +551,7 @@ asmlinkage __visible void smp_irq_move_c
 	retry:
 		irq = __this_cpu_read(vector_irq[vector]);
 
-		if (irq <= VECTOR_UNDEFINED)
+		if (irq <= VECTOR_UNUSED)
 			continue;
 
 		desc = irq_to_desc(irq);
@@ -592,7 +591,7 @@ asmlinkage __visible void smp_irq_move_c
 			apic->send_IPI_self(IRQ_MOVE_CLEANUP_VECTOR);
 			goto unlock;
 		}
-		__this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED);
+		__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
 unlock:
 		raw_spin_unlock(&desc->lock);
 	}
Index: tip/arch/x86/kernel/irq.c
===================================================================
--- tip.orig/arch/x86/kernel/irq.c
+++ tip/arch/x86/kernel/irq.c
@@ -246,7 +246,7 @@ __visible unsigned int __irq_entry do_IR
 					     __func__, smp_processor_id(),
 					     vector, irq);
 		} else {
-			__this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED);
+			__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
 		}
 	}
 
@@ -419,7 +419,7 @@ int check_irq_vectors_for_cpu_disable(vo
 		for (vector = FIRST_EXTERNAL_VECTOR;
 		     vector < first_system_vector; vector++) {
 			if (!test_bit(vector, used_vectors) &&
-			    per_cpu(vector_irq, cpu)[vector] <= VECTOR_UNDEFINED)
+			    per_cpu(vector_irq, cpu)[vector] <= VECTOR_UNUSED)
 				count++;
 		}
 	}
@@ -524,7 +524,7 @@ void fixup_irqs(void)
 	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
 		unsigned int irr;
 
-		if (__this_cpu_read(vector_irq[vector]) <= VECTOR_UNDEFINED)
+		if (__this_cpu_read(vector_irq[vector]) <= VECTOR_UNUSED)
 			continue;
 
 		irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
@@ -542,7 +542,7 @@ void fixup_irqs(void)
 			raw_spin_unlock(&desc->lock);
 		}
 		if (__this_cpu_read(vector_irq[vector]) != VECTOR_RETRIGGERED)
-			__this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED);
+			__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
 	}
 }
 #endif
Index: tip/arch/x86/kernel/irqinit.c
===================================================================
--- tip.orig/arch/x86/kernel/irqinit.c
+++ tip/arch/x86/kernel/irqinit.c
@@ -52,7 +52,7 @@ static struct irqaction irq2 = {
 };
 
 DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
-	[0 ... NR_VECTORS - 1] = VECTOR_UNDEFINED,
+	[0 ... NR_VECTORS - 1] = VECTOR_UNUSED,
 };
 
 int vector_used_by_percpu_irq(unsigned int vector)
@@ -60,7 +60,7 @@ int vector_used_by_percpu_irq(unsigned i
 	int cpu;
 
 	for_each_online_cpu(cpu) {
-		if (per_cpu(vector_irq, cpu)[vector] > VECTOR_UNDEFINED)
+		if (per_cpu(vector_irq, cpu)[vector] > VECTOR_UNUSED)
 			return 1;
 	}
 



  parent reply	other threads:[~2015-08-02 20:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-02 20:38 [patch 0/7] x86: Store irq descriptor in vector array Thomas Gleixner
2015-08-02 20:38 ` [patch 1/7] x86/irq: Protect smp_cleanup_move Thomas Gleixner
2015-08-05 22:19   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-08-02 20:38 ` [patch 2/7] x86/lguest: Do not setup unused irq vectors Thomas Gleixner
2015-08-03  2:47   ` Rusty Russell
2015-08-03  9:40     ` Thomas Gleixner
2015-08-04  4:27       ` Rusty Russell
2015-08-04  4:32         ` [PATCH 1/2] x86/lguest: clean up lguest_setup_irq Rusty Russell
2015-08-04  4:32           ` [PATCH 2/2] x86/lguest: Do not setup unused irq vectors Rusty Russell
2015-08-05 22:19             ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-08-05 22:18           ` [tip:x86/apic] x86/lguest: Clean up lguest_setup_irq tip-bot for Rusty Russell
2015-08-02 20:38 ` [patch 3/7] x86/irq: Replace numeric constant Thomas Gleixner
2015-08-05 22:19   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-08-02 20:38 ` [patch 5/7] x86/irq: Get rid of an indentation level Thomas Gleixner
2015-08-05 22:20   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-08-02 20:38 ` Thomas Gleixner [this message]
2015-08-05 22:20   ` [tip:x86/apic] x86/irq: Rename VECTOR_UNDEFINED to VECTOR_UNUSED tip-bot for Thomas Gleixner
2015-08-02 20:38 ` [patch 6/7] genirq: Provide irq_desc_has_action Thomas Gleixner
2015-08-05 22:20   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-08-02 20:38 ` [patch 7/7] x86/irq: Store irq descriptor in vector array Thomas Gleixner
2015-08-05 22:21   ` [tip:x86/apic] " tip-bot for Thomas Gleixner

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=20150802203609.477282494@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bhelgaas@google.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.