unexport a few symbols in MIPS-specific code
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
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
@@ -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
Ralf Baechle
AppliedRe: [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 removesEXPORT_SYMBOL(copy_user_highpage).Signed-off-by Dmitri Vorobiev <[email protected]>
Queued for 2.6.26. Thanks,
Ralf
PATCH 2/5 unexport copy_to_user_page()
In reply to Dmitri VorobievThe 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
@@ -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
Ralf Baechle
AppliedRe: [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 removesEXPORT_SYMBOL(copy_to_user_page).Signed-off-by Dmitri Vorobiev <[email protected]>
Queued for 2.6.26. Thanks,
Ralf
PATCH 3/5 unexport copy_from_user_page()
In reply to Dmitri VorobievNo 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
@@ -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
Ralf Baechle
AppliedRe: [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.Signed-off-by Dmitri Vorobiev <[email protected]>
Queued for 2.6.26. Thanks,
Ralf
PATCH 4/5 unexport rtc_mips_set_time()
In reply to Dmitri VorobievNo 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
@@ -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
Ralf Baechle
AppliedRe: [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.Signed-off-by Dmitri Vorobiev <[email protected]>
Queued for 2.6.26. Thanks,
Ralf
PATCH 5/5 unexport null_perf_irq() and make it static
In reply to Dmitri VorobievThis 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
@@ -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
@@ -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
@@ -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
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
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/
Ralf Baechle
AppliedRe: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static
In reply to Dmitri VorobievQuoted 4 lines · Dmitri Vorobiev
This patch unexports the
null_perf_irq()symbol, and simultaneously makes this function static.Signed-off-by Dmitri Vorobiev <[email protected]>
Queued for 2.6.26 with your static fix folded in. Thanks,
Ralf
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.Signed-off-by Dmitri Vorobiev <[email protected]>Queued for 2.6.26 with your static fix folded in. Thanks,
Thanks for picking the patches up.
Dmitri
Quoted 3 lines
Ralf
[PATCH 6/5] [MIPS] op_model_mipsxx.c: make the save_perf_irq variable static
In reply to Dmitri VorobievThe 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
@@ -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