All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch: ia64: kernel: irq_ia64.c:  Remove unused function
@ 2014-12-20 17:07 ` Rickard Strandqvist
  0 siblings, 0 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2014-12-20 17:07 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: Rickard Strandqvist, Thomas Gleixner, Grant Likely,
	Christoph Lameter, Tejun Heo, Michael Opdenacker, linux-ia64,
	linux-kernel

Remove the function ia64_handle_irq() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/ia64/kernel/irq_ia64.c |   83 -------------------------------------------
 1 file changed, 83 deletions(-)

diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 698d8fe..1b64f10 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -432,89 +432,6 @@ void destroy_irq(unsigned int irq)
 #	define IS_RESCHEDULE(vec)	(0)
 #	define IS_LOCAL_TLB_FLUSH(vec)	(0)
 #endif
-/*
- * That's where the IVT branches when we get an external
- * interrupt. This branches to the correct hardware IRQ handler via
- * function ptr.
- */
-void
-ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
-{
-	struct pt_regs *old_regs = set_irq_regs(regs);
-	unsigned long saved_tpr;
-
-#if IRQ_DEBUG
-	{
-		unsigned long bsp, sp;
-
-		/*
-		 * Note: if the interrupt happened while executing in
-		 * the context switch routine (ia64_switch_to), we may
-		 * get a spurious stack overflow here.  This is
-		 * because the register and the memory stack are not
-		 * switched atomically.
-		 */
-		bsp = ia64_getreg(_IA64_REG_AR_BSP);
-		sp = ia64_getreg(_IA64_REG_SP);
-
-		if ((sp - bsp) < 1024) {
-			static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
-
-			if (__ratelimit(&ratelimit)) {
-				printk("ia64_handle_irq: DANGER: less than "
-				       "1KB of free stack space!!\n"
-				       "(bsp=0x%lx, sp=%lx)\n", bsp, sp);
-			}
-		}
-	}
-#endif /* IRQ_DEBUG */
-
-	/*
-	 * Always set TPR to limit maximum interrupt nesting depth to
-	 * 16 (without this, it would be ~240, which could easily lead
-	 * to kernel stack overflows).
-	 */
-	irq_enter();
-	saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
-	ia64_srlz_d();
-	while (vector != IA64_SPURIOUS_INT_VECTOR) {
-		int irq = local_vector_to_irq(vector);
-
-		if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
-			smp_local_flush_tlb();
-			kstat_incr_irq_this_cpu(irq);
-		} else if (unlikely(IS_RESCHEDULE(vector))) {
-			scheduler_ipi();
-			kstat_incr_irq_this_cpu(irq);
-		} else {
-			ia64_setreg(_IA64_REG_CR_TPR, vector);
-			ia64_srlz_d();
-
-			if (unlikely(irq < 0)) {
-				printk(KERN_ERR "%s: Unexpected interrupt "
-				       "vector %d on CPU %d is not mapped "
-				       "to any IRQ!\n", __func__, vector,
-				       smp_processor_id());
-			} else
-				generic_handle_irq(irq);
-
-			/*
-			 * Disable interrupts and send EOI:
-			 */
-			local_irq_disable();
-			ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
-		}
-		ia64_eoi();
-		vector = ia64_get_ivr();
-	}
-	/*
-	 * This must be done *after* the ia64_eoi().  For example, the keyboard softirq
-	 * handler needs to be able to wait for further keyboard interrupts, which can't
-	 * come through until ia64_eoi() has been done.
-	 */
-	irq_exit();
-	set_irq_regs(old_regs);
-}
 
 #ifdef CONFIG_HOTPLUG_CPU
 /*
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] arch: ia64: kernel: irq_ia64.c:  Remove unused function
@ 2014-12-20 17:07 ` Rickard Strandqvist
  0 siblings, 0 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2014-12-20 17:07 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: Rickard Strandqvist, Thomas Gleixner, Grant Likely,
	Christoph Lameter, Tejun Heo, Michael Opdenacker, linux-ia64,
	linux-kernel

Remove the function ia64_handle_irq() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/ia64/kernel/irq_ia64.c |   83 -------------------------------------------
 1 file changed, 83 deletions(-)

diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 698d8fe..1b64f10 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -432,89 +432,6 @@ void destroy_irq(unsigned int irq)
 #	define IS_RESCHEDULE(vec)	(0)
 #	define IS_LOCAL_TLB_FLUSH(vec)	(0)
 #endif
-/*
- * That's where the IVT branches when we get an external
- * interrupt. This branches to the correct hardware IRQ handler via
- * function ptr.
- */
-void
-ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
-{
-	struct pt_regs *old_regs = set_irq_regs(regs);
-	unsigned long saved_tpr;
-
-#if IRQ_DEBUG
-	{
-		unsigned long bsp, sp;
-
-		/*
-		 * Note: if the interrupt happened while executing in
-		 * the context switch routine (ia64_switch_to), we may
-		 * get a spurious stack overflow here.  This is
-		 * because the register and the memory stack are not
-		 * switched atomically.
-		 */
-		bsp = ia64_getreg(_IA64_REG_AR_BSP);
-		sp = ia64_getreg(_IA64_REG_SP);
-
-		if ((sp - bsp) < 1024) {
-			static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
-
-			if (__ratelimit(&ratelimit)) {
-				printk("ia64_handle_irq: DANGER: less than "
-				       "1KB of free stack space!!\n"
-				       "(bsp=0x%lx, sp=%lx)\n", bsp, sp);
-			}
-		}
-	}
-#endif /* IRQ_DEBUG */
-
-	/*
-	 * Always set TPR to limit maximum interrupt nesting depth to
-	 * 16 (without this, it would be ~240, which could easily lead
-	 * to kernel stack overflows).
-	 */
-	irq_enter();
-	saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
-	ia64_srlz_d();
-	while (vector != IA64_SPURIOUS_INT_VECTOR) {
-		int irq = local_vector_to_irq(vector);
-
-		if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
-			smp_local_flush_tlb();
-			kstat_incr_irq_this_cpu(irq);
-		} else if (unlikely(IS_RESCHEDULE(vector))) {
-			scheduler_ipi();
-			kstat_incr_irq_this_cpu(irq);
-		} else {
-			ia64_setreg(_IA64_REG_CR_TPR, vector);
-			ia64_srlz_d();
-
-			if (unlikely(irq < 0)) {
-				printk(KERN_ERR "%s: Unexpected interrupt "
-				       "vector %d on CPU %d is not mapped "
-				       "to any IRQ!\n", __func__, vector,
-				       smp_processor_id());
-			} else
-				generic_handle_irq(irq);
-
-			/*
-			 * Disable interrupts and send EOI:
-			 */
-			local_irq_disable();
-			ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
-		}
-		ia64_eoi();
-		vector = ia64_get_ivr();
-	}
-	/*
-	 * This must be done *after* the ia64_eoi().  For example, the keyboard softirq
-	 * handler needs to be able to wait for further keyboard interrupts, which can't
-	 * come through until ia64_eoi() has been done.
-	 */
-	irq_exit();
-	set_irq_regs(old_regs);
-}
 
 #ifdef CONFIG_HOTPLUG_CPU
 /*
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] arch: ia64: kernel: irq_ia64.c:  Remove some unused functions
  2014-12-20 17:07 ` Rickard Strandqvist
@ 2014-12-20 22:54 ` Rickard Strandqvist
  -1 siblings, 0 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2014-12-20 22:54 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: Rickard Strandqvist, Thomas Gleixner, Grant Likely,
	Christoph Lameter, Tejun Heo, Michael Opdenacker, linux-ia64,
	linux-kernel

Removes some functions that are not used anywhere:
rnat_consumption() inat_page_consumption() privilege_reg()
unimpl_daddr() privilege_op() rsv_reg_field() illegal_dep()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/ia64/kvm/process.c |   70 -----------------------------------------------
 1 file changed, 70 deletions(-)

diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index b039874..ab9d9e7 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -302,56 +302,6 @@ void illegal_op(struct kvm_vcpu *vcpu)
 	_general_exception(vcpu);
 }
 
-/*
- * Illegal Dependency Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void illegal_dep(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
-/*
- * Reserved Register/Field Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void rsv_reg_field(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-/*
- * Privileged Operation Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-
-void privilege_op(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
-/*
- * Unimplement Data Address Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void unimpl_daddr(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
-/*
- * Privileged Register Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void privilege_reg(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
 /* Deal with
  *  Nat consumption vector
  * Parameter:
@@ -370,26 +320,6 @@ static void _nat_consumption_fault(struct kvm_vcpu *vcpu, u64 vadr,
 }
 
 /*
- * Instruction Nat Page Consumption Fault
- *  @ Nat Consumption Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void inat_page_consumption(struct kvm_vcpu *vcpu, u64 vadr)
-{
-	_nat_consumption_fault(vcpu, vadr, INSTRUCTION);
-}
-
-/*
- * Register Nat Consumption Fault
- *  @ Nat Consumption Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void rnat_consumption(struct kvm_vcpu *vcpu)
-{
-	_nat_consumption_fault(vcpu, 0, REGISTER);
-}
-
-/*
  * Data Nat Page Consumption Fault
  *  @ Nat Consumption Vector
  * Refer to SDM Vol2 Table 5-6 & 8-1
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] arch: ia64: kernel: irq_ia64.c:  Remove some unused functions
@ 2014-12-20 22:54 ` Rickard Strandqvist
  0 siblings, 0 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2014-12-20 22:54 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: Rickard Strandqvist, Thomas Gleixner, Grant Likely,
	Christoph Lameter, Tejun Heo, Michael Opdenacker, linux-ia64,
	linux-kernel

Removes some functions that are not used anywhere:
rnat_consumption() inat_page_consumption() privilege_reg()
unimpl_daddr() privilege_op() rsv_reg_field() illegal_dep()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/ia64/kvm/process.c |   70 -----------------------------------------------
 1 file changed, 70 deletions(-)

diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index b039874..ab9d9e7 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -302,56 +302,6 @@ void illegal_op(struct kvm_vcpu *vcpu)
 	_general_exception(vcpu);
 }
 
-/*
- * Illegal Dependency Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void illegal_dep(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
-/*
- * Reserved Register/Field Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void rsv_reg_field(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-/*
- * Privileged Operation Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-
-void privilege_op(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
-/*
- * Unimplement Data Address Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void unimpl_daddr(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
-/*
- * Privileged Register Fault
- *  @ General Exception Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void privilege_reg(struct kvm_vcpu *vcpu)
-{
-	_general_exception(vcpu);
-}
-
 /* Deal with
  *  Nat consumption vector
  * Parameter:
@@ -370,26 +320,6 @@ static void _nat_consumption_fault(struct kvm_vcpu *vcpu, u64 vadr,
 }
 
 /*
- * Instruction Nat Page Consumption Fault
- *  @ Nat Consumption Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void inat_page_consumption(struct kvm_vcpu *vcpu, u64 vadr)
-{
-	_nat_consumption_fault(vcpu, vadr, INSTRUCTION);
-}
-
-/*
- * Register Nat Consumption Fault
- *  @ Nat Consumption Vector
- * Refer to SDM Vol2 Table 5-6 & 8-1
- */
-void rnat_consumption(struct kvm_vcpu *vcpu)
-{
-	_nat_consumption_fault(vcpu, 0, REGISTER);
-}
-
-/*
  * Data Nat Page Consumption Fault
  *  @ Nat Consumption Vector
  * Refer to SDM Vol2 Table 5-6 & 8-1
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] arch: ia64: kernel: irq_ia64.c: Remove unused function
  2014-12-20 17:07 ` Rickard Strandqvist
@ 2015-01-05 19:33   ` Tony Luck
  -1 siblings, 0 replies; 8+ messages in thread
From: Tony Luck @ 2015-01-05 19:33 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Fenghua Yu, Thomas Gleixner, Grant Likely, Christoph Lameter,
	Tejun Heo, Michael Opdenacker, linux-ia64,
	Linux Kernel Mailing List

On Sat, Dec 20, 2014 at 9:07 AM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> Remove the function ia64_handle_irq() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.

$ git grep ia64_handle_irq
arch/ia64/kernel/irq_ia64.c:ia64_handle_irq (ia64_vector vector,
struct pt_regs *regs)
arch/ia64/kernel/irq_ia64.c:
printk("ia64_handle_irq: DANGER: less than "
arch/ia64/kernel/irq_ia64.c:                     * Now try calling
normal ia64_handle_irq as it would have got called
arch/ia64/kernel/ivt.S: br.call.sptk.many b6=ia64_handle_irq

Note that last line. ia64_handle_irq() is called from assembly code

-Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] arch: ia64: kernel: irq_ia64.c: Remove unused function
@ 2015-01-05 19:33   ` Tony Luck
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Luck @ 2015-01-05 19:33 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Fenghua Yu, Thomas Gleixner, Grant Likely, Christoph Lameter,
	Tejun Heo, Michael Opdenacker, linux-ia64,
	Linux Kernel Mailing List

On Sat, Dec 20, 2014 at 9:07 AM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> Remove the function ia64_handle_irq() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.

$ git grep ia64_handle_irq
arch/ia64/kernel/irq_ia64.c:ia64_handle_irq (ia64_vector vector,
struct pt_regs *regs)
arch/ia64/kernel/irq_ia64.c:
printk("ia64_handle_irq: DANGER: less than "
arch/ia64/kernel/irq_ia64.c:                     * Now try calling
normal ia64_handle_irq as it would have got called
arch/ia64/kernel/ivt.S: br.call.sptk.many b6=ia64_handle_irq

Note that last line. ia64_handle_irq() is called from assembly code

-Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] arch: ia64: kernel: irq_ia64.c: Remove unused function
  2015-01-05 19:33   ` Tony Luck
@ 2015-01-06 18:28     ` Rickard Strandqvist
  -1 siblings, 0 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2015-01-06 18:28 UTC (permalink / raw)
  To: Tony Luck
  Cc: Fenghua Yu, Thomas Gleixner, Grant Likely, Christoph Lameter,
	Tejun Heo, Michael Opdenacker, linux-ia64,
	Linux Kernel Mailing List

2015-01-05 20:33 GMT+01:00 Tony Luck <tony.luck@gmail.com>:
> On Sat, Dec 20, 2014 at 9:07 AM, Rickard Strandqvist
> <rickard_strandqvist@spectrumdigital.se> wrote:
>> Remove the function ia64_handle_irq() that is not used anywhere.
>>
>> This was partially found by using a static code analysis program called cppcheck.
>
> $ git grep ia64_handle_irq
> arch/ia64/kernel/irq_ia64.c:ia64_handle_irq (ia64_vector vector,
> struct pt_regs *regs)
> arch/ia64/kernel/irq_ia64.c:
> printk("ia64_handle_irq: DANGER: less than "
> arch/ia64/kernel/irq_ia64.c:                     * Now try calling
> normal ia64_handle_irq as it would have got called
> arch/ia64/kernel/ivt.S: br.call.sptk.many b6=ia64_handle_irq
>
> Note that last line. ia64_handle_irq() is called from assembly code
>
> -Tony


Hi Tony

Excuse me, this was a totally unnecessary patch :(
I have otherwise tried to pay attention to just that.

Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] arch: ia64: kernel: irq_ia64.c: Remove unused function
@ 2015-01-06 18:28     ` Rickard Strandqvist
  0 siblings, 0 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2015-01-06 18:28 UTC (permalink / raw)
  To: Tony Luck
  Cc: Fenghua Yu, Thomas Gleixner, Grant Likely, Christoph Lameter,
	Tejun Heo, Michael Opdenacker, linux-ia64,
	Linux Kernel Mailing List

2015-01-05 20:33 GMT+01:00 Tony Luck <tony.luck@gmail.com>:
> On Sat, Dec 20, 2014 at 9:07 AM, Rickard Strandqvist
> <rickard_strandqvist@spectrumdigital.se> wrote:
>> Remove the function ia64_handle_irq() that is not used anywhere.
>>
>> This was partially found by using a static code analysis program called cppcheck.
>
> $ git grep ia64_handle_irq
> arch/ia64/kernel/irq_ia64.c:ia64_handle_irq (ia64_vector vector,
> struct pt_regs *regs)
> arch/ia64/kernel/irq_ia64.c:
> printk("ia64_handle_irq: DANGER: less than "
> arch/ia64/kernel/irq_ia64.c:                     * Now try calling
> normal ia64_handle_irq as it would have got called
> arch/ia64/kernel/ivt.S: br.call.sptk.many b6=ia64_handle_irq
>
> Note that last line. ia64_handle_irq() is called from assembly code
>
> -Tony


Hi Tony

Excuse me, this was a totally unnecessary patch :(
I have otherwise tried to pay attention to just that.

Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-06 18:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-20 17:07 [PATCH] arch: ia64: kernel: irq_ia64.c: Remove unused function Rickard Strandqvist
2014-12-20 17:07 ` Rickard Strandqvist
2015-01-05 19:33 ` Tony Luck
2015-01-05 19:33   ` Tony Luck
2015-01-06 18:28   ` Rickard Strandqvist
2015-01-06 18:28     ` Rickard Strandqvist
2014-12-20 22:54 [PATCH] arch: ia64: kernel: irq_ia64.c: Remove some unused functions Rickard Strandqvist
2014-12-20 22:54 ` Rickard Strandqvist

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.