Commit 12ae4bff authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] make kstack_depth_to_print and some APM stuff static

Tridge has written a little utility
(http://samba.org/ftp/unpacked/junkcode/findstatic.pl) that (given a set of
object files) works out a list of candidate finctions and variables that
may be able to be made static.  Obviously some hand checking is needed
(different configs and/or architectures etc), but it seems useful.

Here is my first patch using its outout.

kstack_depth_to_print is used in many architectures, but only in one
file in each.  In some architectures it is declared and not used.  It
is not even clear why kstack_depth_to_print is not a #define.  Tridge
suggested that maybe you could change its value with a debugger ...

The APM code has a function and a struct that can be static.
parent 6ce1b826
...@@ -141,7 +141,7 @@ void show_trace_task(struct task_struct * tsk) ...@@ -141,7 +141,7 @@ void show_trace_task(struct task_struct * tsk)
} }
} }
int kstack_depth_to_print = 24; static int kstack_depth_to_print = 24;
void show_stack(unsigned long *sp) void show_stack(unsigned long *sp)
{ {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
int kstack_depth_to_print = 24; static int kstack_depth_to_print = 24;
void show_trace(unsigned long * stack) void show_trace(unsigned long * stack)
{ {
......
...@@ -922,12 +922,13 @@ static void apm_power_off(void) ...@@ -922,12 +922,13 @@ static void apm_power_off(void)
* callback we use. * callback we use.
*/ */
void handle_poweroff (int key, struct pt_regs *pt_regs, static void handle_poweroff (int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct kbd_struct *kbd, struct tty_struct *tty)
{
apm_power_off(); apm_power_off();
} }
struct sysrq_key_op sysrq_poweroff_op = { static struct sysrq_key_op sysrq_poweroff_op = {
handler: handle_poweroff, handler: handle_poweroff,
help_msg: "Off", help_msg: "Off",
action_msg: "Power Off\n" action_msg: "Power Off\n"
......
...@@ -89,7 +89,7 @@ asmlinkage void alignment_check(void); ...@@ -89,7 +89,7 @@ asmlinkage void alignment_check(void);
asmlinkage void spurious_interrupt_bug(void); asmlinkage void spurious_interrupt_bug(void);
asmlinkage void machine_check(void); asmlinkage void machine_check(void);
int kstack_depth_to_print = 24; static int kstack_depth_to_print = 24;
/* /*
......
...@@ -815,7 +815,7 @@ asmlinkage void buserr_c(struct frame *fp) ...@@ -815,7 +815,7 @@ asmlinkage void buserr_c(struct frame *fp)
} }
int kstack_depth_to_print = 48; static int kstack_depth_to_print = 48;
extern struct module kernel_module; extern struct module kernel_module;
static inline int kernel_text_address(unsigned long addr) static inline int kernel_text_address(unsigned long addr)
......
...@@ -69,8 +69,6 @@ char watch_available = 0; ...@@ -69,8 +69,6 @@ char watch_available = 0;
void (*ibe_board_handler)(struct pt_regs *regs); void (*ibe_board_handler)(struct pt_regs *regs);
void (*dbe_board_handler)(struct pt_regs *regs); void (*dbe_board_handler)(struct pt_regs *regs);
int kstack_depth_to_print = 24;
/* /*
* These constant is for searching for possible module text segments. * These constant is for searching for possible module text segments.
* MODULE_RANGE is a guess of how much space is likely to be vmalloced. * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
......
...@@ -51,8 +51,6 @@ char dedicated_iv_available = 0; ...@@ -51,8 +51,6 @@ char dedicated_iv_available = 0;
char vce_available = 0; char vce_available = 0;
char mips4_available = 0; char mips4_available = 0;
int kstack_depth_to_print = 24;
/* /*
* These constant is for searching for possible module text segments. * These constant is for searching for possible module text segments.
* MODULE_RANGE is a guess of how much space is likely to be vmalloced. * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
......
...@@ -58,8 +58,6 @@ void page_exception(void); ...@@ -58,8 +58,6 @@ void page_exception(void);
#define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_OFFSET (8*1024*1024)
#define MODULE_RANGE (8*1024*1024) #define MODULE_RANGE (8*1024*1024)
int kstack_depth_to_print = 24;
static void printbinary(unsigned long x, int nbits) static void printbinary(unsigned long x, int nbits)
{ {
unsigned long mask = 1UL << (nbits - 1); unsigned long mask = 1UL << (nbits - 1);
......
...@@ -61,7 +61,7 @@ extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code); ...@@ -61,7 +61,7 @@ extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code);
static ext_int_info_t ext_int_pfault; static ext_int_info_t ext_int_pfault;
#endif #endif
int kstack_depth_to_print = 12; static int kstack_depth_to_print = 12;
/* /*
* If the address is either in the .text section of the * If the address is either in the .text section of the
......
...@@ -63,7 +63,7 @@ extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code); ...@@ -63,7 +63,7 @@ extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code);
static ext_int_info_t ext_int_pfault; static ext_int_info_t ext_int_pfault;
#endif #endif
int kstack_depth_to_print = 20; static int kstack_depth_to_print = 20;
/* /*
* If the address is either in the .text section of the * If the address is either in the .text section of the
......
...@@ -81,7 +81,7 @@ extern int exception_trace; ...@@ -81,7 +81,7 @@ extern int exception_trace;
struct notifier_block *die_chain; struct notifier_block *die_chain;
int kstack_depth_to_print = 10; static int kstack_depth_to_print = 10;
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment