Commit ae87487b authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

[PATCH] janitor: don't init statics to 0

From: Leann Ogasawara <ogasawara@osdl.org>

Uninitialize static variables initialized to 0 so they are pushed to the
.bss instead of .data.
parent 53ef8f80
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#define IDX7 27333 #define IDX7 27333
#define IDX8 3000 #define IDX8 3000
static int mode = 0; static int mode;
static char *xbuf; static char *xbuf;
static char *tvmem; static char *tvmem;
......
...@@ -766,8 +766,8 @@ EXPORT_SYMBOL(cpufreq_set_policy); ...@@ -766,8 +766,8 @@ EXPORT_SYMBOL(cpufreq_set_policy);
* per-CPU loops_per_jiffy value wherever possible. * per-CPU loops_per_jiffy value wherever possible.
*/ */
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
static unsigned long l_p_j_ref = 0; static unsigned long l_p_j_ref;
static unsigned int l_p_j_ref_freq = 0; static unsigned int l_p_j_ref_freq;
static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
{ {
......
...@@ -347,7 +347,7 @@ void __release_region(struct resource *parent, unsigned long start, unsigned lon ...@@ -347,7 +347,7 @@ void __release_region(struct resource *parent, unsigned long start, unsigned lon
#define MAXRESERVE 4 #define MAXRESERVE 4
static int __init reserve_setup(char *str) static int __init reserve_setup(char *str)
{ {
static int reserved = 0; static int reserved;
static struct resource reserve[MAXRESERVE]; static struct resource reserve[MAXRESERVE];
for (;;) { for (;;) {
......
...@@ -92,18 +92,18 @@ spinlock_t suspend_pagedir_lock __nosavedata = SPIN_LOCK_UNLOCKED; ...@@ -92,18 +92,18 @@ spinlock_t suspend_pagedir_lock __nosavedata = SPIN_LOCK_UNLOCKED;
/* Variables to be preserved over suspend */ /* Variables to be preserved over suspend */
static int new_loglevel = 7; static int new_loglevel = 7;
static int orig_loglevel = 0; static int orig_loglevel;
static int orig_fgconsole, orig_kmsg; static int orig_fgconsole, orig_kmsg;
static int pagedir_order_check; static int pagedir_order_check;
static int nr_copy_pages_check; static int nr_copy_pages_check;
static int resume_status = 0; static int resume_status;
static char resume_file[256] = ""; /* For resume= kernel option */ static char resume_file[256] = ""; /* For resume= kernel option */
static dev_t resume_device; static dev_t resume_device;
/* Local variables that should not be affected by save */ /* Local variables that should not be affected by save */
unsigned int nr_copy_pages __nosavedata = 0; unsigned int nr_copy_pages __nosavedata = 0;
static int pm_suspend_state = 0; static int pm_suspend_state;
/* Suspend pagedir is allocated before final copy, therefore it /* Suspend pagedir is allocated before final copy, therefore it
must be freed after resume must be freed after resume
......
...@@ -585,7 +585,7 @@ static ctl_table kern_table[] = { ...@@ -585,7 +585,7 @@ static ctl_table kern_table[] = {
/* Constants for minimum and maximum testing in vm_table. /* Constants for minimum and maximum testing in vm_table.
We use these as one-element integer vectors. */ We use these as one-element integer vectors. */
static int zero = 0; static int zero;
static int one_hundred = 100; static int one_hundred = 100;
......
...@@ -228,7 +228,7 @@ static void send_bits( ...@@ -228,7 +228,7 @@ static void send_bits(
*/ */
static void tr_static_init(void) static void tr_static_init(void)
{ {
static int static_init_done = 0; static int static_init_done;
int n; /* iterates over tree elements */ int n; /* iterates over tree elements */
int bits; /* bit counter */ int bits; /* bit counter */
int length; /* length value */ int length; /* length value */
......
...@@ -296,7 +296,7 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long ...@@ -296,7 +296,7 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long
struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
struct page *page = NULL; struct page *page = NULL;
swp_entry_t *entry; swp_entry_t *entry;
static const swp_entry_t unswapped = {0}; static const swp_entry_t unswapped;
if (sgp != SGP_WRITE && if (sgp != SGP_WRITE &&
((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) ((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode))
......
...@@ -1222,7 +1222,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) ...@@ -1222,7 +1222,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
unsigned int type; unsigned int type;
int i, prev; int i, prev;
int error; int error;
static int least_priority = 0; static int least_priority;
union swap_header *swap_header = 0; union swap_header *swap_header = 0;
int swap_header_version; int swap_header_version;
int nr_good_pages = 0; int nr_good_pages = 0;
......
...@@ -56,7 +56,7 @@ GdkColor color; ...@@ -56,7 +56,7 @@ GdkColor color;
GtkTreeStore *tree1, *tree2, *tree; GtkTreeStore *tree1, *tree2, *tree;
GtkTreeModel *model1, *model2; GtkTreeModel *model1, *model2;
static GtkTreeIter *parents[256] = { 0 }; static GtkTreeIter *parents[256];
static gint indent; static gint indent;
static struct menu *current; // current node for SINGLE view static struct menu *current; // current node for SINGLE view
...@@ -110,7 +110,7 @@ const char *dbg_print_stype(int val) ...@@ -110,7 +110,7 @@ const char *dbg_print_stype(int val)
const char *dbg_print_flags(int val) const char *dbg_print_flags(int val)
{ {
static char buf[256] = { 0 }; static char buf[256];
bzero(buf, 256); bzero(buf, 256);
...@@ -577,7 +577,7 @@ void ...@@ -577,7 +577,7 @@ void
on_window1_size_request(GtkWidget * widget, on_window1_size_request(GtkWidget * widget,
GtkRequisition * requisition, gpointer user_data) GtkRequisition * requisition, gpointer user_data)
{ {
static gint old_h = 0; static gint old_h;
gint w, h; gint w, h;
if (widget->window == NULL) if (widget->window == NULL)
...@@ -1184,7 +1184,7 @@ on_treeview1_button_press_event(GtkWidget * widget, ...@@ -1184,7 +1184,7 @@ on_treeview1_button_press_event(GtkWidget * widget,
/* Fill a row of strings */ /* Fill a row of strings */
static gchar **fill_row(struct menu *menu) static gchar **fill_row(struct menu *menu)
{ {
static gchar *row[COL_NUMBER] = { 0 }; static gchar *row[COL_NUMBER];
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
const char *def; const char *def;
int stype; int stype;
......
...@@ -85,7 +85,7 @@ static char buf[4096], *bufptr = buf; ...@@ -85,7 +85,7 @@ static char buf[4096], *bufptr = buf;
static char input_buf[4096]; static char input_buf[4096];
static char filename[PATH_MAX+1] = ".config"; static char filename[PATH_MAX+1] = ".config";
static char *args[1024], **argptr = args; static char *args[1024], **argptr = args;
static int indent = 0; static int indent;
static struct termios ios_org; static struct termios ios_org;
static int rows, cols; static int rows, cols;
static struct menu *current_menu; static struct menu *current_menu;
......
...@@ -27,8 +27,8 @@ static void print_line (WINDOW * win, int row, int width); ...@@ -27,8 +27,8 @@ static void print_line (WINDOW * win, int row, int width);
static char *get_line (void); static char *get_line (void);
static void print_position (WINDOW * win, int height, int width); static void print_position (WINDOW * win, int height, int width);
static int hscroll = 0, fd, file_size, bytes_read; static int hscroll, fd, file_size, bytes_read;
static int begin_reached = 1, end_reached = 0, page_length; static int begin_reached = 1, end_reached, page_length;
static char *buf, *page; static char *buf, *page;
/* /*
......
...@@ -73,7 +73,7 @@ static unsigned int logo_width; ...@@ -73,7 +73,7 @@ static unsigned int logo_width;
static unsigned int logo_height; static unsigned int logo_height;
static struct color **logo_data; static struct color **logo_data;
static struct color logo_clut[MAX_LINUX_LOGO_COLORS]; static struct color logo_clut[MAX_LINUX_LOGO_COLORS];
static unsigned int logo_clutsize = 0; static unsigned int logo_clutsize;
static void die(const char *fmt, ...) static void die(const char *fmt, ...)
__attribute__ ((noreturn)) __attribute ((format (printf, 1, 2))); __attribute__ ((noreturn)) __attribute ((format (printf, 1, 2)));
...@@ -259,7 +259,7 @@ static void write_footer(void) ...@@ -259,7 +259,7 @@ static void write_footer(void)
fclose(out); fclose(out);
} }
static int write_hex_cnt = 0; static int write_hex_cnt;
static void write_hex(unsigned char byte) static void write_hex(unsigned char byte)
{ {
......
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