Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] make lots of things static

Another large rollup of various patches from Adrian which make things static
where they were needlessly exported.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Adrian Bunk and committed by
Linus Torvalds
408b664a c31403a1

+67 -70
+2 -2
arch/i386/kernel/cpu/mtrr/generic.c
··· 124 124 return -ENOSPC; 125 125 } 126 126 127 - void generic_get_mtrr(unsigned int reg, unsigned long *base, 128 - unsigned int *size, mtrr_type * type) 127 + static void generic_get_mtrr(unsigned int reg, unsigned long *base, 128 + unsigned int *size, mtrr_type * type) 129 129 { 130 130 unsigned int mask_lo, mask_hi, base_lo, base_hi; 131 131
+1 -1
arch/x86_64/kernel/early_printk.c
··· 60 60 61 61 /* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ 62 62 63 - int early_serial_base = 0x3f8; /* ttyS0 */ 63 + static int early_serial_base = 0x3f8; /* ttyS0 */ 64 64 65 65 #define XMTRDY 0x20 66 66
+2 -2
drivers/char/agp/ali-agp.c
··· 192 192 {4, 1024, 0, 3} 193 193 }; 194 194 195 - struct agp_bridge_driver ali_generic_bridge = { 195 + static struct agp_bridge_driver ali_generic_bridge = { 196 196 .owner = THIS_MODULE, 197 197 .aperture_sizes = ali_generic_sizes, 198 198 .size_type = U32_APER_SIZE, ··· 215 215 .agp_destroy_page = ali_destroy_page, 216 216 }; 217 217 218 - struct agp_bridge_driver ali_m1541_bridge = { 218 + static struct agp_bridge_driver ali_m1541_bridge = { 219 219 .owner = THIS_MODULE, 220 220 .aperture_sizes = ali_generic_sizes, 221 221 .size_type = U32_APER_SIZE,
+1 -1
drivers/char/agp/amd-k7-agp.c
··· 358 358 {.mask = 1, .type = 0} 359 359 }; 360 360 361 - struct agp_bridge_driver amd_irongate_driver = { 361 + static struct agp_bridge_driver amd_irongate_driver = { 362 362 .owner = THIS_MODULE, 363 363 .aperture_sizes = amd_irongate_sizes, 364 364 .size_type = LVL2_APER_SIZE,
+1 -1
drivers/char/agp/amd64-agp.c
··· 243 243 } 244 244 245 245 246 - struct agp_bridge_driver amd_8151_driver = { 246 + static struct agp_bridge_driver amd_8151_driver = { 247 247 .owner = THIS_MODULE, 248 248 .aperture_sizes = amd_8151_sizes, 249 249 .size_type = U32_APER_SIZE,
+1 -1
drivers/char/agp/ati-agp.c
··· 393 393 return 0; 394 394 } 395 395 396 - struct agp_bridge_driver ati_generic_bridge = { 396 + static struct agp_bridge_driver ati_generic_bridge = { 397 397 .owner = THIS_MODULE, 398 398 .aperture_sizes = ati_generic_sizes, 399 399 .size_type = LVL2_APER_SIZE,
+2 -2
drivers/char/agp/backend.c
··· 97 97 EXPORT_SYMBOL(agp_backend_release); 98 98 99 99 100 - struct { int mem, agp; } maxes_table[] = { 100 + static struct { int mem, agp; } maxes_table[] = { 101 101 {0, 0}, 102 102 {32, 4}, 103 103 {64, 28}, ··· 322 322 return 0; 323 323 } 324 324 325 - void __exit agp_exit(void) 325 + static void __exit agp_exit(void) 326 326 { 327 327 } 328 328
+1 -1
drivers/char/agp/efficeon-agp.c
··· 303 303 } 304 304 305 305 306 - struct agp_bridge_driver efficeon_driver = { 306 + static struct agp_bridge_driver efficeon_driver = { 307 307 .owner = THIS_MODULE, 308 308 .aperture_sizes = efficeon_generic_sizes, 309 309 .size_type = LVL2_APER_SIZE,
+3 -3
drivers/char/agp/frontend.c
··· 235 235 236 236 /* File private list routines */ 237 237 238 - struct agp_file_private *agp_find_private(pid_t pid) 238 + static struct agp_file_private *agp_find_private(pid_t pid) 239 239 { 240 240 struct agp_file_private *curr; 241 241 ··· 250 250 return NULL; 251 251 } 252 252 253 - void agp_insert_file_private(struct agp_file_private * priv) 253 + static void agp_insert_file_private(struct agp_file_private * priv) 254 254 { 255 255 struct agp_file_private *prev; 256 256 ··· 262 262 agp_fe.file_priv_list = priv; 263 263 } 264 264 265 - void agp_remove_file_private(struct agp_file_private * priv) 265 + static void agp_remove_file_private(struct agp_file_private * priv) 266 266 { 267 267 struct agp_file_private *next; 268 268 struct agp_file_private *prev;
+1 -1
drivers/char/agp/nvidia-agp.c
··· 288 288 }; 289 289 290 290 291 - struct agp_bridge_driver nvidia_driver = { 291 + static struct agp_bridge_driver nvidia_driver = { 292 292 .owner = THIS_MODULE, 293 293 .aperture_sizes = nvidia_generic_sizes, 294 294 .size_type = U8_APER_SIZE,
+1 -1
drivers/char/agp/sis-agp.c
··· 119 119 {4, 1024, 0, 3} 120 120 }; 121 121 122 - struct agp_bridge_driver sis_driver = { 122 + static struct agp_bridge_driver sis_driver = { 123 123 .owner = THIS_MODULE, 124 124 .aperture_sizes = sis_generic_sizes, 125 125 .size_type = U8_APER_SIZE,
+1 -1
drivers/char/agp/sworks-agp.c
··· 409 409 agp_device_command(command, 0); 410 410 } 411 411 412 - struct agp_bridge_driver sworks_driver = { 412 + static struct agp_bridge_driver sworks_driver = { 413 413 .owner = THIS_MODULE, 414 414 .aperture_sizes = serverworks_sizes, 415 415 .size_type = LVL2_APER_SIZE,
+2 -2
drivers/char/agp/via-agp.c
··· 170 170 } 171 171 172 172 173 - struct agp_bridge_driver via_agp3_driver = { 173 + static struct agp_bridge_driver via_agp3_driver = { 174 174 .owner = THIS_MODULE, 175 175 .aperture_sizes = agp3_generic_sizes, 176 176 .size_type = U8_APER_SIZE, ··· 193 193 .agp_destroy_page = agp_generic_destroy_page, 194 194 }; 195 195 196 - struct agp_bridge_driver via_driver = { 196 + static struct agp_bridge_driver via_driver = { 197 197 .owner = THIS_MODULE, 198 198 .aperture_sizes = via_generic_sizes, 199 199 .size_type = U8_APER_SIZE,
+1 -1
drivers/char/rio/rio_linux.c
··· 221 221 /* Set the mask to all-ones. This alas, only supports 32 interrupts. 222 222 Some architectures may need more. -- Changed to LONG to 223 223 support up to 64 bits on 64bit architectures. -- REW 20/06/99 */ 224 - long rio_irqmask = -1; 224 + static long rio_irqmask = -1; 225 225 226 226 MODULE_AUTHOR("Rogier Wolff <R.E.Wolff@bitwizard.nl>, Patrick van de Lageweg <patrick@bitwizard.nl>"); 227 227 MODULE_DESCRIPTION("RIO driver");
+2 -2
drivers/char/stallion.c
··· 466 466 467 467 static unsigned long stl_atol(char *str); 468 468 469 - int stl_init(void); 469 + static int stl_init(void); 470 470 static int stl_open(struct tty_struct *tty, struct file *filp); 471 471 static void stl_close(struct tty_struct *tty, struct file *filp); 472 472 static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count); ··· 3063 3063 3064 3064 /*****************************************************************************/ 3065 3065 3066 - int __init stl_init(void) 3066 + static int __init stl_init(void) 3067 3067 { 3068 3068 int i; 3069 3069 printk(KERN_INFO "%s: version %s\n", stl_drvtitle, stl_drvversion);
+5 -5
drivers/isdn/capi/capi.c
··· 60 60 61 61 static struct class_simple *capi_class; 62 62 63 - int capi_major = 68; /* allocated */ 63 + static int capi_major = 68; /* allocated */ 64 64 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 65 65 #define CAPINC_NR_PORTS 32 66 66 #define CAPINC_MAX_PORTS 256 67 - int capi_ttymajor = 191; 68 - int capi_ttyminors = CAPINC_NR_PORTS; 67 + static int capi_ttymajor = 191; 68 + static int capi_ttyminors = CAPINC_NR_PORTS; 69 69 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 70 70 71 71 module_param_named(major, capi_major, uint, 0); ··· 268 268 kfree(mp); 269 269 } 270 270 271 - struct capiminor *capiminor_find(unsigned int minor) 271 + static struct capiminor *capiminor_find(unsigned int minor) 272 272 { 273 273 struct list_head *l; 274 274 struct capiminor *p = NULL; ··· 1166 1166 return room; 1167 1167 } 1168 1168 1169 - int capinc_tty_chars_in_buffer(struct tty_struct *tty) 1169 + static int capinc_tty_chars_in_buffer(struct tty_struct *tty) 1170 1170 { 1171 1171 struct capiminor *mp = (struct capiminor *)tty->driver_data; 1172 1172 if (!mp || !mp->nccip) {
+5 -5
drivers/isdn/capi/kcapi_proc.c
··· 89 89 return 0; 90 90 } 91 91 92 - struct seq_operations seq_controller_ops = { 92 + static struct seq_operations seq_controller_ops = { 93 93 .start = controller_start, 94 94 .next = controller_next, 95 95 .stop = controller_stop, 96 96 .show = controller_show, 97 97 }; 98 98 99 - struct seq_operations seq_contrstats_ops = { 99 + static struct seq_operations seq_contrstats_ops = { 100 100 .start = controller_start, 101 101 .next = controller_next, 102 102 .stop = controller_stop, ··· 192 192 return 0; 193 193 } 194 194 195 - struct seq_operations seq_applications_ops = { 195 + static struct seq_operations seq_applications_ops = { 196 196 .start = applications_start, 197 197 .next = applications_next, 198 198 .stop = applications_stop, 199 199 .show = applications_show, 200 200 }; 201 201 202 - struct seq_operations seq_applstats_ops = { 202 + static struct seq_operations seq_applstats_ops = { 203 203 .start = applications_start, 204 204 .next = applications_next, 205 205 .stop = applications_stop, ··· 287 287 return 0; 288 288 } 289 289 290 - struct seq_operations seq_capi_driver_ops = { 290 + static struct seq_operations seq_capi_driver_ops = { 291 291 .start = capi_driver_start, 292 292 .next = capi_driver_next, 293 293 .stop = capi_driver_stop,
+5 -5
drivers/isdn/divert/isdn_divert.c
··· 383 383 /*************************************************/ 384 384 /* called from common module on an incoming call */ 385 385 /*************************************************/ 386 - int isdn_divert_icall(isdn_ctrl *ic) 386 + static int isdn_divert_icall(isdn_ctrl *ic) 387 387 { int retval = 0; 388 388 unsigned long flags; 389 389 struct call_struc *cs = NULL; ··· 552 552 /****************************************************/ 553 553 /* put a address including address type into buffer */ 554 554 /****************************************************/ 555 - int put_address(char *st, u_char *p, int len) 555 + static int put_address(char *st, u_char *p, int len) 556 556 { u_char retval = 0; 557 557 u_char adr_typ = 0; /* network standard */ 558 558 ··· 595 595 /*************************************/ 596 596 /* report a succesfull interrogation */ 597 597 /*************************************/ 598 - int interrogate_success(isdn_ctrl *ic, struct call_struc *cs) 598 + static int interrogate_success(isdn_ctrl *ic, struct call_struc *cs) 599 599 { char *src = ic->parm.dss1_io.data; 600 600 int restlen = ic->parm.dss1_io.datalen; 601 601 int cnt = 1; ··· 689 689 /*********************************************/ 690 690 /* callback for protocol specific extensions */ 691 691 /*********************************************/ 692 - int prot_stat_callback(isdn_ctrl *ic) 692 + static int prot_stat_callback(isdn_ctrl *ic) 693 693 { struct call_struc *cs, *cs1; 694 694 int i; 695 695 unsigned long flags; ··· 781 781 /***************************/ 782 782 /* status callback from HL */ 783 783 /***************************/ 784 - int isdn_divert_stat_callback(isdn_ctrl *ic) 784 + static int isdn_divert_stat_callback(isdn_ctrl *ic) 785 785 { struct call_struc *cs, *cs1; 786 786 unsigned long flags; 787 787 int retval;
+3 -3
drivers/media/video/bttv-driver.c
··· 3169 3169 /* ----------------------------------------------------------------------- */ 3170 3170 /* some debug code */ 3171 3171 3172 - int bttv_risc_decode(u32 risc) 3172 + static int bttv_risc_decode(u32 risc) 3173 3173 { 3174 3174 static char *instr[16] = { 3175 3175 [ BT848_RISC_WRITE >> 28 ] = "write", ··· 3206 3206 return incr[risc >> 28] ? incr[risc >> 28] : 1; 3207 3207 } 3208 3208 3209 - void bttv_risc_disasm(struct bttv *btv, 3210 - struct btcx_riscmem *risc) 3209 + static void bttv_risc_disasm(struct bttv *btv, 3210 + struct btcx_riscmem *risc) 3211 3211 { 3212 3212 unsigned int i,j,n; 3213 3213
+2 -3
drivers/media/video/cx88/cx88-core.c
··· 429 429 /* ------------------------------------------------------------------ */ 430 430 /* debug helper code */ 431 431 432 - int cx88_risc_decode(u32 risc) 432 + static int cx88_risc_decode(u32 risc) 433 433 { 434 434 static char *instr[16] = { 435 435 [ RISC_SYNC >> 28 ] = "sync", ··· 542 542 core->name,cx_read(ch->cnt2_reg)); 543 543 } 544 544 545 - char *cx88_pci_irqs[32] = { 545 + static char *cx88_pci_irqs[32] = { 546 546 "vid", "aud", "ts", "vip", "hst", "5", "6", "tm1", 547 547 "src_dma", "dst_dma", "risc_rd_err", "risc_wr_err", 548 548 "brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err", ··· 1206 1206 /* ------------------------------------------------------------------ */ 1207 1207 1208 1208 EXPORT_SYMBOL(cx88_print_ioctl); 1209 - EXPORT_SYMBOL(cx88_pci_irqs); 1210 1209 EXPORT_SYMBOL(cx88_vid_irqs); 1211 1210 EXPORT_SYMBOL(cx88_mpeg_irqs); 1212 1211 EXPORT_SYMBOL(cx88_print_irqbits);
+2 -2
drivers/media/video/cx88/cx88-dvb.c
··· 91 91 cx88_free_buffer(dev->pci, (struct cx88_buffer*)vb); 92 92 } 93 93 94 - struct videobuf_queue_ops dvb_qops = { 94 + static struct videobuf_queue_ops dvb_qops = { 95 95 .buf_setup = dvb_buf_setup, 96 96 .buf_prepare = dvb_buf_prepare, 97 97 .buf_queue = dvb_buf_queue, ··· 191 191 return 0; 192 192 } 193 193 194 - struct or51132_config pchdtv_hd3000 = { 194 + static struct or51132_config pchdtv_hd3000 = { 195 195 .demod_address = 0x15, 196 196 .pll_address = 0x61, 197 197 .pll_desc = &dvb_pll_thomson_dtt7610,
+2 -2
drivers/media/video/cx88/cx88-i2c.c
··· 45 45 46 46 /* ----------------------------------------------------------------------- */ 47 47 48 - void cx8800_bit_setscl(void *data, int state) 48 + static void cx8800_bit_setscl(void *data, int state) 49 49 { 50 50 struct cx88_core *core = data; 51 51 ··· 57 57 cx_read(MO_I2C); 58 58 } 59 59 60 - void cx8800_bit_setsda(void *data, int state) 60 + static void cx8800_bit_setsda(void *data, int state) 61 61 { 62 62 struct cx88_core *core = data; 63 63
+3 -3
drivers/media/video/cx88/cx88-vbi.c
··· 46 46 } 47 47 } 48 48 49 - int cx8800_start_vbi_dma(struct cx8800_dev *dev, 50 - struct cx88_dmaqueue *q, 51 - struct cx88_buffer *buf) 49 + static int cx8800_start_vbi_dma(struct cx8800_dev *dev, 50 + struct cx88_dmaqueue *q, 51 + struct cx88_buffer *buf) 52 52 { 53 53 struct cx88_core *core = dev->core; 54 54
+6 -6
drivers/media/video/cx88/cx88-video.c
··· 325 325 .shift = 0, 326 326 } 327 327 }; 328 - const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); 328 + static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); 329 329 330 330 /* ------------------------------------------------------------------- */ 331 331 /* resource management */ ··· 665 665 cx88_free_buffer(fh->dev->pci,buf); 666 666 } 667 667 668 - struct videobuf_queue_ops cx8800_video_qops = { 668 + static struct videobuf_queue_ops cx8800_video_qops = { 669 669 .buf_setup = buffer_setup, 670 670 .buf_prepare = buffer_prepare, 671 671 .buf_queue = buffer_queue, ··· 1924 1924 .llseek = no_llseek, 1925 1925 }; 1926 1926 1927 - struct video_device cx8800_video_template = 1927 + static struct video_device cx8800_video_template = 1928 1928 { 1929 1929 .name = "cx8800-video", 1930 1930 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, ··· 1933 1933 .minor = -1, 1934 1934 }; 1935 1935 1936 - struct video_device cx8800_vbi_template = 1936 + static struct video_device cx8800_vbi_template = 1937 1937 { 1938 1938 .name = "cx8800-vbi", 1939 1939 .type = VID_TYPE_TELETEXT|VID_TYPE_TUNER, ··· 1951 1951 .llseek = no_llseek, 1952 1952 }; 1953 1953 1954 - struct video_device cx8800_radio_template = 1954 + static struct video_device cx8800_radio_template = 1955 1955 { 1956 1956 .name = "cx8800-radio", 1957 1957 .type = VID_TYPE_TUNER, ··· 2226 2226 2227 2227 /* ----------------------------------------------------------- */ 2228 2228 2229 - struct pci_device_id cx8800_pci_tbl[] = { 2229 + static struct pci_device_id cx8800_pci_tbl[] = { 2230 2230 { 2231 2231 .vendor = 0x14f1, 2232 2232 .device = 0x8800,
-4
drivers/media/video/cx88/cx88.h
··· 420 420 /* ----------------------------------------------------------- */ 421 421 /* cx88-core.c */ 422 422 423 - extern char *cx88_pci_irqs[32]; 424 423 extern char *cx88_vid_irqs[32]; 425 424 extern char *cx88_mpeg_irqs[32]; 426 425 extern void cx88_print_irqbits(char *name, char *tag, char **strings, ··· 471 472 /* cx88-vbi.c */ 472 473 473 474 void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f); 474 - int cx8800_start_vbi_dma(struct cx8800_dev *dev, 475 - struct cx88_dmaqueue *q, 476 - struct cx88_buffer *buf); 477 475 int cx8800_stop_vbi_dma(struct cx8800_dev *dev); 478 476 int cx8800_restart_vbi_queue(struct cx8800_dev *dev, 479 477 struct cx88_dmaqueue *q);
+1 -1
drivers/media/video/saa7134/saa7134-dvb.c
··· 172 172 return request_firmware(fw, name, &dev->pci->dev); 173 173 } 174 174 175 - struct tda1004x_config medion_cardbus = { 175 + static struct tda1004x_config medion_cardbus = { 176 176 .demod_address = 0x08, /* not sure this is correct */ 177 177 .invert = 0, 178 178 .invert_oclk = 0,
+3 -3
drivers/scsi/pas16.c
··· 137 137 static int pas16_irq = 0; 138 138 139 139 140 - int scsi_irq_translate[] = 140 + static const int scsi_irq_translate[] = 141 141 { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 }; 142 142 143 143 /* The default_irqs array contains values used to set the irq into the ··· 145 145 * irq jumpers on the board). The first value in the array will be 146 146 * assigned to logical board 0, the next to board 1, etc. 147 147 */ 148 - int default_irqs[] __initdata = 148 + static int default_irqs[] __initdata = 149 149 { PAS16_DEFAULT_BOARD_1_IRQ, 150 150 PAS16_DEFAULT_BOARD_2_IRQ, 151 151 PAS16_DEFAULT_BOARD_3_IRQ, ··· 177 177 178 178 #define NO_BASES (sizeof (bases) / sizeof (struct base)) 179 179 180 - unsigned short pas16_offset[ 8 ] = 180 + static const unsigned short pas16_offset[ 8 ] = 181 181 { 182 182 0x1c00, /* OUTPUT_DATA_REG */ 183 183 0x1c01, /* INITIATOR_COMMAND_REG */
+1 -1
drivers/serial/8250.c
··· 51 51 * share_irqs - whether we pass SA_SHIRQ to request_irq(). This option 52 52 * is unsafe when used on edge-triggered interrupts. 53 53 */ 54 - unsigned int share_irqs = SERIAL8250_SHARE_IRQS; 54 + static unsigned int share_irqs = SERIAL8250_SHARE_IRQS; 55 55 56 56 /* 57 57 * Debugging.
-1
drivers/serial/jsm/jsm.h
··· 393 393 int jsm_uart_port_init(struct jsm_board *); 394 394 int jsm_remove_uart_port(struct jsm_board *); 395 395 void jsm_input(struct jsm_channel *ch); 396 - void jsm_carrier(struct jsm_channel *ch); 397 396 void jsm_check_queue_flow_control(struct jsm_channel *ch); 398 397 399 398 #endif
+1 -1
drivers/serial/jsm/jsm_neo.c
··· 688 688 /* 689 689 * No locks are assumed to be held when calling this function. 690 690 */ 691 - void neo_clear_break(struct jsm_channel *ch, int force) 691 + static void neo_clear_break(struct jsm_channel *ch, int force) 692 692 { 693 693 unsigned long lock_flags; 694 694
+3 -1
drivers/serial/jsm/jsm_tty.c
··· 31 31 32 32 #include "jsm.h" 33 33 34 + static void jsm_carrier(struct jsm_channel *ch); 35 + 34 36 static inline int jsm_get_mstat(struct jsm_channel *ch) 35 37 { 36 38 unsigned char mstat; ··· 757 755 jsm_printk(IOCTL, INFO, &ch->ch_bd->pci_dev, "finish\n"); 758 756 } 759 757 760 - void jsm_carrier(struct jsm_channel *ch) 758 + static void jsm_carrier(struct jsm_channel *ch) 761 759 { 762 760 struct jsm_board *bd; 763 761
-1
include/linux/sched.h
··· 1012 1012 extern void flush_thread(void); 1013 1013 extern void exit_thread(void); 1014 1014 1015 - extern void exit_mm(struct task_struct *); 1016 1015 extern void exit_files(struct task_struct *); 1017 1016 extern void exit_signal(struct task_struct *); 1018 1017 extern void __exit_signal(struct task_struct *);
+3 -1
kernel/exit.c
··· 39 39 40 40 int getrusage(struct task_struct *, int, struct rusage __user *); 41 41 42 + static void exit_mm(struct task_struct * tsk); 43 + 42 44 static void __unhash_process(struct task_struct *p) 43 45 { 44 46 nr_threads--; ··· 476 474 * Turn us into a lazy TLB process if we 477 475 * aren't already.. 478 476 */ 479 - void exit_mm(struct task_struct * tsk) 477 + static void exit_mm(struct task_struct * tsk) 480 478 { 481 479 struct mm_struct *mm = tsk->mm; 482 480