Skip to contentSkip to conversation

unexport a few symbols in MIPS-specific code

PATCH Applied Dmitri Vorobiev 3 participants 15 messages Apr 1, 2008 – Apr 5, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

cover unexport a few symbols in MIPS-specific code

Hi Ralf,

A few exported symbols in MIPS-specific code can be unexported, and this series of patches does so.

This series was tested using a custom config that was produced by running `make allmodconfig', after which the CONFIG_VORTEX option was manually turned off. The patches I am submitting do not touch the code affected by this option, however. Setting this options on leads to unbuildable kernel independently of whether the patches are applied.

Additionally, the entire patchset was tested at runtime by booting the Malta 4Kc board up to the shell prompt and inserting the `oprofile.ko' kernel module. The tests were successful.

Thanks,
Dmitri

#1 lore raw

PATCH 1/5 unexport copy_user_highpage()

The copy_user_highpage() routine has no users outside of the core kernel code, so exporting this symbol is pointless. This patch removes EXPORT_SYMBOL(copy_user_highpage).

---
 arch/mips/mm/init.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/mips/mm/init.c +0 -2
index c7aed13..71e5962 100644
@@ -229,8 +229,6 @@ void copy_user_highpage(struct page *to, struct page *from,
 	smp_wmb();
 }
 
-EXPORT_SYMBOL(copy_user_highpage);
-
 void copy_to_user_page(struct vm_area_struct *vma,
 	struct page *page, unsigned long vaddr, void *dst, const void *src,
 	unsigned long len)
Signature · 1 line
1.5.3
Applied
#2 lore raw

Re: [PATCH 1/5] [MIPS] unexport copy_user_highpage()

Quoted 5 lines · Dmitri Vorobiev

The copy_user_highpage() routine has no users outside of the core kernel code, so exporting this symbol is pointless. This patch removes EXPORT_SYMBOL(copy_user_highpage).

Queued for 2.6.26. Thanks,

Ralf

#3 lore raw

PATCH 2/5 unexport copy_to_user_page()

In reply to Dmitri Vorobiev

The copy_to_user_page() function is called only in the core kernel code. Therefore, there is no need to export it. This patch removes EXPORT_SYMBOL(copy_to_user_page).

---
 arch/mips/mm/init.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/mips/mm/init.c +0 -2
index 71e5962..6b9d54b 100644
@@ -247,8 +247,6 @@ void copy_to_user_page(struct vm_area_struct *vma,
 		flush_cache_page(vma, vaddr, page_to_pfn(page));
 }
 
-EXPORT_SYMBOL(copy_to_user_page);
-
 void copy_from_user_page(struct vm_area_struct *vma,
 	struct page *page, unsigned long vaddr, void *dst, const void *src,
 	unsigned long len)
Signature · 1 line
1.5.3
Applied
#4 lore raw

Re: [PATCH 2/5] [MIPS] unexport copy_to_user_page()

Quoted 5 lines · Dmitri Vorobiev

The copy_to_user_page() function is called only in the core kernel code. Therefore, there is no need to export it. This patch removes EXPORT_SYMBOL(copy_to_user_page).

Queued for 2.6.26. Thanks,

Ralf

#5 lore raw

PATCH 3/5 unexport copy_from_user_page()

In reply to Dmitri Vorobiev

No users for the copy_from_user_page() routine exist outside of the core kernel code. Therefore, EXPORT_SYMBOL(copy_from_user_page) is useless, and this patch removes it.

---
 arch/mips/mm/init.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
arch/mips/mm/init.c +0 -3
index 6b9d54b..ff61184 100644
@@ -263,9 +263,6 @@ void copy_from_user_page(struct vm_area_struct *vma,
 	}
 }
 
-EXPORT_SYMBOL(copy_from_user_page);
-
-
 #ifdef CONFIG_HIGHMEM
 unsigned long highstart_pfn, highend_pfn;
 
Signature · 1 line
1.5.3
Applied
#6 lore raw

Re: [PATCH 3/5] [MIPS] unexport copy_from_user_page()

Quoted 5 lines · Dmitri Vorobiev

No users for the copy_from_user_page() routine exist outside of the core kernel code. Therefore, EXPORT_SYMBOL(copy_from_user_page) is useless, and this patch removes it.

Queued for 2.6.26. Thanks,

Ralf

#7 lore raw

PATCH 4/5 unexport rtc_mips_set_time()

In reply to Dmitri Vorobiev

No users for the rtc_mips_set_time() routine exist outside of the core kernel code. Therefore, EXPORT_SYMBOL(rtc_mips_set_time) is useless, and this patch removes it.

---
 arch/mips/kernel/time.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/mips/kernel/time.c +0 -1
index b45a709..d70ce5c 100644
@@ -38,7 +38,6 @@ int __weak rtc_mips_set_time(unsigned long sec)
 {
 	return 0;
 }
-EXPORT_SYMBOL(rtc_mips_set_time);
 
 int __weak rtc_mips_set_mmss(unsigned long nowtime)
 {
Signature · 1 line
1.5.3
Applied
#8 lore raw

Re: [PATCH 4/5] [MIPS] unexport rtc_mips_set_time()

Quoted 5 lines · Dmitri Vorobiev

No users for the rtc_mips_set_time() routine exist outside of the core kernel code. Therefore, EXPORT_SYMBOL(rtc_mips_set_time) is useless, and this patch removes it.

Queued for 2.6.26. Thanks,

Ralf

#9 lore raw

PATCH 5/5 unexport null_perf_irq() and make it static

In reply to Dmitri Vorobiev

This patch unexports the null_perf_irq() symbol, and simultaneously makes this function static.

---
 arch/mips/kernel/time.c              |    4 +---
 arch/mips/oprofile/op_impl.h         |    1 -
 arch/mips/oprofile/op_model_mipsxx.c |    5 ++++-
 3 files changed, 5 insertions(+), 5 deletions(-)
arch/mips/kernel/time.c +1 -3
index d70ce5c..1f467d5 100644
@@ -49,13 +49,11 @@ int update_persistent_clock(struct timespec now)
 	return rtc_mips_set_mmss(now.tv_sec);
 }
 
-int null_perf_irq(void)
+static int null_perf_irq(void)
 {
 	return 0;
 }
 
-EXPORT_SYMBOL(null_perf_irq);
-
 int (*perf_irq)(void) = null_perf_irq;
 
 EXPORT_SYMBOL(perf_irq);
arch/mips/oprofile/op_impl.h +0 -1
index fa6b4aa..2bfc17c 100644
@@ -10,7 +10,6 @@
 #ifndef OP_IMPL_H
 #define OP_IMPL_H 1
 
-extern int null_perf_irq(void);
 extern int (*perf_irq)(void);
 
 /* Per-counter configuration as set via oprofilefs.  */
arch/mips/oprofile/op_model_mipsxx.c +4 -1
index ccbea22..12e840f 100644
@@ -31,6 +31,8 @@
 
 #define M_COUNTER_OVERFLOW		(1UL      << 31)
 
+int (*save_perf_irq)(void);
+
 #ifdef CONFIG_MIPS_MT_SMP
 #define WHAT		(M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
 #define vpe_id()	smp_processor_id()
@@ -355,6 +357,7 @@ static int __init mipsxx_init(void)
 		return -ENODEV;
 	}
 
+	save_perf_irq = perf_irq;
 	perf_irq = mipsxx_perfcount_handler;
 
 	return 0;
@@ -367,7 +370,7 @@ static void mipsxx_exit(void)
 	counters = counters_per_cpu_to_total(counters);
 	reset_counters(counters);
 
-	perf_irq = null_perf_irq;
+	perf_irq = save_perf_irq;
 }
 
 struct op_mips_model op_model_mipsxx_ops = {
Signature · 1 line
1.5.3
#10 lore raw

Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static

arch/mips/oprofile/op_model_mipsxx.c line 34

Quoted 7 lines · Dmitri Vorobiev
arch/mips/oprofile/op_model_mipsxx.c +1 -0
@@ -31,6 +31,8 @@
 
 #define M_COUNTER_OVERFLOW		(1UL      << 31)
 
+int (*save_perf_irq)(void);

This should be another target of "make it static" patch :-)

---
Atsushi Nemoto

#11 lore raw

Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static

Atsushi Nemoto пишет:

Quoted 10 lines · Dmitri Vorobiev

arch/mips/oprofile/op_model_mipsxx.c line 34

Quoted 7 lines
arch/mips/oprofile/op_model_mipsxx.c +1 -0
@@ -31,6 +31,8 @@
 
 #define M_COUNTER_OVERFLOW		(1UL      << 31)
 
+int (*save_perf_irq)(void);

This should be another target of "make it static" patch :-)

Indeed. Thank you for noticing that.

Quoted 9 lines

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#13 lore raw

Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static

Ralf Baechle пишет:

Quoted 8 lines · Dmitri Vorobiev
Quoted 5 lines

This patch unexports the null_perf_irq() symbol, and simultaneously makes this function static.

Queued for 2.6.26 with your static fix folded in. Thanks,

Thanks for picking the patches up.

Dmitri

Quoted 3 lines

Ralf

#14 lore raw

[PATCH 6/5] [MIPS] op_model_mipsxx.c: make the save_perf_irq variable static

In reply to Dmitri Vorobiev

The function pointer save_perf_irq introduced by the previous patch in this series can become static.

Thanks for Atsushi Nemoto for pointing out the possibility.

---
Hi Ralf,

If you find that the series is worth it, please pick up this patch too. Thank you.

Dmitri

 arch/mips/oprofile/op_model_mipsxx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/oprofile/op_model_mipsxx.c +1 -1
index 12e840f..0a11727 100644
@@ -31,7 +31,7 @@
 
 #define M_COUNTER_OVERFLOW		(1UL      << 31)
 
-int (*save_perf_irq)(void);
+static int (*save_perf_irq)(void);
 
 #ifdef CONFIG_MIPS_MT_SMP
 #define WHAT		(M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
Signature · 1 line
1.5.3