]> git.hungrycats.org Git - linux/commitdiff
[PATCH] make kstack_depth_to_print and some APM stuff static
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 20 Jun 2002 05:25:59 +0000 (22:25 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 20 Jun 2002 05:25:59 +0000 (22:25 -0700)
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.

arch/alpha/kernel/traps.c
arch/cris/kernel/traps.c
arch/i386/kernel/apm.c
arch/i386/kernel/traps.c
arch/m68k/kernel/traps.c
arch/mips/kernel/traps.c
arch/mips64/kernel/traps.c
arch/parisc/kernel/traps.c
arch/s390/kernel/traps.c
arch/s390x/kernel/traps.c
arch/x86_64/kernel/traps.c

index 4134812b88a0473eb1fa1455a8ed009f4e09212b..3f9a1830b26f86866db5a6e6fc51cf5f93dbbc05 100644 (file)
@@ -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)
 {
index af7d639de3b6259dae2431eb35935eefe9103614..cae9ff41318258ba085ef568c29ddf990006d4a9 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 
-int kstack_depth_to_print = 24;
+static int kstack_depth_to_print = 24;
 
 void show_trace(unsigned long * stack)
 {
index c25fa0f4586cd533f407f6843b5bb32d03b1156b..d6814ebef9a4eff60116db41cefd90c6e9bf173b 100644 (file)
@@ -922,12 +922,13 @@ static void apm_power_off(void)
  * callback we use.
  */
 
-void handle_poweroff (int key, struct pt_regs *pt_regs,
-               struct kbd_struct *kbd, struct tty_struct *tty) {
+static void handle_poweroff (int key, struct pt_regs *pt_regs,
+               struct kbd_struct *kbd, struct tty_struct *tty)
+{
         apm_power_off();
 }
 
-struct sysrq_key_op    sysrq_poweroff_op = {
+static struct sysrq_key_op     sysrq_poweroff_op = {
        handler:        handle_poweroff,
        help_msg:       "Off",
        action_msg:     "Power Off\n"
index 0d4730c3629b0b7118517a68998c093808da88c3..6ab2d98ca508cb6c50c227ed6e4d49a61f2a446d 100644 (file)
@@ -89,7 +89,7 @@ asmlinkage void alignment_check(void);
 asmlinkage void spurious_interrupt_bug(void);
 asmlinkage void machine_check(void);
 
-int kstack_depth_to_print = 24;
+static int kstack_depth_to_print = 24;
 
 
 /*
index d044b58b0fdc714aca86a3189aafb08ebccfd09d..a02127d984c06461bad064160d250f344be16f32 100644 (file)
@@ -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;
 
 static inline int kernel_text_address(unsigned long addr)
index ea08d1d9e4dbe8131c5979de6ab69a718d57c856..5a25242b368d6ad96bfa0382cae0ba50605c195f 100644 (file)
@@ -69,8 +69,6 @@ char watch_available = 0;
 void (*ibe_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.
  * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
index 2d59f7b898aba1684592dd22956f2f33dd21a377..7161c7f967afdf864036e0c71eee2ab5dca76b56 100644 (file)
@@ -51,8 +51,6 @@ char dedicated_iv_available = 0;
 char vce_available = 0;
 char mips4_available = 0;
 
-int kstack_depth_to_print = 24;
-
 /*
  * These constant is for searching for possible module text segments.
  * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
index d901209f27cc67d49b232c68b7362eed1e0b02fc..67e04660523e5a2f7089ab03e27f6d12084475a1 100644 (file)
@@ -58,8 +58,6 @@ void page_exception(void);
 #define VMALLOC_OFFSET (8*1024*1024)
 #define MODULE_RANGE (8*1024*1024)
 
-int kstack_depth_to_print = 24;
-
 static void printbinary(unsigned long x, int nbits)
 {
        unsigned long mask = 1UL << (nbits - 1);
index 14e6f0a6c4bd0d47db04b46342b5c7a4ed5de92a..8f28efda890c9a0be9036baf89581d0730fc1ccd 100644 (file)
@@ -61,7 +61,7 @@ extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code);
 static ext_int_info_t ext_int_pfault;
 #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
index 04ea37adedeac598f5f162730a4725950bac2043..0f00eac30601539d4bc56b4c3e453505162a5a24 100644 (file)
@@ -63,7 +63,7 @@ extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code);
 static ext_int_info_t ext_int_pfault;
 #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
index 93b92a9298d1ad759608fa04b345010c96e2bfb5..fe7a298db43c7a63508cf8b6ad516d4a72ea4257 100644 (file)
@@ -81,7 +81,7 @@ extern int exception_trace;
 
 struct notifier_block *die_chain;
 
-int kstack_depth_to_print = 10;
+static int kstack_depth_to_print = 10;
 
 #ifdef CONFIG_KALLSYMS
 #include <linux/kallsyms.h>