Commit 8dfbdf4abad6e5a7bbd097bf7e2c0ec41e0c54b4
Committed by
Linus Torvalds
1 parent
5575d0a3c9
Exists in
master
and in
7 other branches
m68k/mac/: possible cleanups
This patch contains the following possible cleanups: - make the following needlessly global code (always) static: - baboon.c: struct baboon - baboon.c: baboon_irq() - config.c: mac_orig_videoaddr - config.c: mac_identify() - config.c: mac_report_hardware() - config.c: mac_debug_console_write() - config.c: mac_sccb_console_write() - config.c: mac_scca_console_write() - config.c: mac_init_scc_port() - oss.c: oss_irq() - oss.c: oss_nubus_irq() - psc.c: psc_debug_dump() - psc.c: psc_dma_die_die_die() - via.c: rbv_clear - remove the unused bootparse.c - #if 0 the following unused functions: - config.c: mac_debugging_short() - config.c: mac_debugging_long() - remove the following unused code: - config.c: mac_bisize - config.c: mac_env - config.c: mac_SCC_init_done - config.c: mac_SCC_reset_done - config.c: mac_init_scca_port() - config.c: mac_init_sccb_port() Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 11 changed files with 35 additions and 189 deletions Side-by-side Diff
arch/m68k/mac/Makefile
arch/m68k/mac/baboon.c
... | ... | @@ -23,10 +23,8 @@ |
23 | 23 | /* #define DEBUG_IRQS */ |
24 | 24 | |
25 | 25 | int baboon_present; |
26 | -volatile struct baboon *baboon; | |
26 | +static volatile struct baboon *baboon; | |
27 | 27 | |
28 | -irqreturn_t baboon_irq(int, void *); | |
29 | - | |
30 | 28 | #if 0 |
31 | 29 | extern int macide_ack_intr(struct ata_channel *); |
32 | 30 | #endif |
33 | 31 | |
... | ... | @@ -50,20 +48,10 @@ |
50 | 48 | } |
51 | 49 | |
52 | 50 | /* |
53 | - * Register the Baboon interrupt dispatcher on nubus slot $C. | |
54 | - */ | |
55 | - | |
56 | -void __init baboon_register_interrupts(void) | |
57 | -{ | |
58 | - request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | |
59 | - "baboon", (void *) baboon); | |
60 | -} | |
61 | - | |
62 | -/* | |
63 | 51 | * Baboon interrupt handler. This works a lot like a VIA. |
64 | 52 | */ |
65 | 53 | |
66 | -irqreturn_t baboon_irq(int irq, void *dev_id) | |
54 | +static irqreturn_t baboon_irq(int irq, void *dev_id) | |
67 | 55 | { |
68 | 56 | int irq_bit, irq_num; |
69 | 57 | unsigned char events; |
... | ... | @@ -93,6 +81,16 @@ |
93 | 81 | baboon->mb_ifr &= ~events; |
94 | 82 | #endif |
95 | 83 | return IRQ_HANDLED; |
84 | +} | |
85 | + | |
86 | +/* | |
87 | + * Register the Baboon interrupt dispatcher on nubus slot $C. | |
88 | + */ | |
89 | + | |
90 | +void __init baboon_register_interrupts(void) | |
91 | +{ | |
92 | + request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | |
93 | + "baboon", (void *) baboon); | |
96 | 94 | } |
97 | 95 | |
98 | 96 | void baboon_irq_enable(int irq) { |
arch/m68k/mac/bootparse.c
1 | -#include <linux/string.h> | |
2 | -#include <linux/kernel.h> | |
3 | -#include <linux/sched.h> | |
4 | -#include <asm/irq.h> | |
5 | -#include <asm/setup.h> | |
6 | -#include <asm/bootinfo.h> | |
7 | -#include <asm/macintosh.h> | |
8 | - | |
9 | -/* | |
10 | - * Booter vars | |
11 | - */ | |
12 | - | |
13 | -int boothowto; | |
14 | -int _boothowto; | |
15 | - | |
16 | -/* | |
17 | - * Called early to parse the environment (passed to us from the booter) | |
18 | - * into a bootinfo struct. Will die as soon as we have our own booter | |
19 | - */ | |
20 | - | |
21 | -#define atol(x) simple_strtoul(x,NULL,0) | |
22 | - | |
23 | -void parse_booter(char *env) | |
24 | -{ | |
25 | - char *name; | |
26 | - char *value; | |
27 | -#if 0 | |
28 | - while(0 && *env) | |
29 | -#else | |
30 | - while(*env) | |
31 | -#endif | |
32 | - { | |
33 | - name=env; | |
34 | - value=name; | |
35 | - while(*value!='='&&*value) | |
36 | - value++; | |
37 | - if(*value=='=') | |
38 | - *value++=0; | |
39 | - env=value; | |
40 | - while(*env) | |
41 | - env++; | |
42 | - env++; | |
43 | -#if 0 | |
44 | - if(strcmp(name,"VIDEO_ADDR")==0) | |
45 | - mac_mch.videoaddr=atol(value); | |
46 | - if(strcmp(name,"ROW_BYTES")==0) | |
47 | - mac_mch.videorow=atol(value); | |
48 | - if(strcmp(name,"SCREEN_DEPTH")==0) | |
49 | - mac_mch.videodepth=atol(value); | |
50 | - if(strcmp(name,"DIMENSIONS")==0) | |
51 | - mac_mch.dimensions=atol(value); | |
52 | -#endif | |
53 | - if(strcmp(name,"BOOTTIME")==0) | |
54 | - mac_bi_data.boottime=atol(value); | |
55 | - if(strcmp(name,"GMTBIAS")==0) | |
56 | - mac_bi_data.gmtbias=atol(value); | |
57 | - if(strcmp(name,"BOOTERVER")==0) | |
58 | - mac_bi_data.bootver=atol(value); | |
59 | - if(strcmp(name,"MACOS_VIDEO")==0) | |
60 | - mac_bi_data.videological=atol(value); | |
61 | - if(strcmp(name,"MACOS_SCC")==0) | |
62 | - mac_bi_data.sccbase=atol(value); | |
63 | - if(strcmp(name,"MACHINEID")==0) | |
64 | - mac_bi_data.id=atol(value); | |
65 | - if(strcmp(name,"MEMSIZE")==0) | |
66 | - mac_bi_data.memsize=atol(value); | |
67 | - if(strcmp(name,"SERIAL_MODEM_FLAGS")==0) | |
68 | - mac_bi_data.serialmf=atol(value); | |
69 | - if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0) | |
70 | - mac_bi_data.serialhsk=atol(value); | |
71 | - if(strcmp(name,"SERIAL_MODEM_GPICLK")==0) | |
72 | - mac_bi_data.serialgpi=atol(value); | |
73 | - if(strcmp(name,"SERIAL_PRINT_FLAGS")==0) | |
74 | - mac_bi_data.printmf=atol(value); | |
75 | - if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0) | |
76 | - mac_bi_data.printhsk=atol(value); | |
77 | - if(strcmp(name,"SERIAL_PRINT_GPICLK")==0) | |
78 | - mac_bi_data.printgpi=atol(value); | |
79 | - if(strcmp(name,"PROCESSOR")==0) | |
80 | - mac_bi_data.cpuid=atol(value); | |
81 | - if(strcmp(name,"ROMBASE")==0) | |
82 | - mac_bi_data.rombase=atol(value); | |
83 | - if(strcmp(name,"TIMEDBRA")==0) | |
84 | - mac_bi_data.timedbra=atol(value); | |
85 | - if(strcmp(name,"ADBDELAY")==0) | |
86 | - mac_bi_data.adbdelay=atol(value); | |
87 | - } | |
88 | -#if 0 /* XXX: TODO with m68k_mach_* */ | |
89 | - /* Fill in the base stuff */ | |
90 | - boot_info.machtype=MACH_MAC; | |
91 | - /* Read this from the macinfo we got ! */ | |
92 | -/* boot_info.cputype=CPU_68020|FPUB_68881;*/ | |
93 | -/* boot_info.memory[0].addr=0;*/ | |
94 | -/* boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/ | |
95 | - boot_info.num_memory=1; /* On a MacII */ | |
96 | - boot_info.ramdisk_size=0; /* For now */ | |
97 | - *boot_info.command_line=0; | |
98 | -#endif | |
99 | - } | |
100 | - | |
101 | - | |
102 | -void print_booter(char *env) | |
103 | -{ | |
104 | - char *name; | |
105 | - char *value; | |
106 | - while(*env) | |
107 | - { | |
108 | - name=env; | |
109 | - value=name; | |
110 | - while(*value!='='&&*value) | |
111 | - value++; | |
112 | - if(*value=='=') | |
113 | - *value++=0; | |
114 | - env=value; | |
115 | - while(*env) | |
116 | - env++; | |
117 | - env++; | |
118 | - printk("%s=%s\n", name,value); | |
119 | - } | |
120 | - } |
arch/m68k/mac/config.c
... | ... | @@ -46,7 +46,6 @@ |
46 | 46 | /* Mac bootinfo struct */ |
47 | 47 | |
48 | 48 | struct mac_booter_data mac_bi_data; |
49 | -int mac_bisize = sizeof mac_bi_data; | |
50 | 49 | |
51 | 50 | /* New m68k bootinfo stuff and videobase */ |
52 | 51 | |
53 | 52 | |
... | ... | @@ -55,10 +54,8 @@ |
55 | 54 | |
56 | 55 | extern struct mem_info m68k_ramdisk; |
57 | 56 | |
58 | -void *mac_env; /* Loaded by the boot asm */ | |
59 | - | |
60 | 57 | /* The phys. video addr. - might be bogus on some machines */ |
61 | -unsigned long mac_orig_videoaddr; | |
58 | +static unsigned long mac_orig_videoaddr; | |
62 | 59 | |
63 | 60 | /* Mac specific timer functions */ |
64 | 61 | extern unsigned long mac_gettimeoffset(void); |
... | ... | @@ -79,6 +76,8 @@ |
79 | 76 | extern void nubus_sweep_video(void); |
80 | 77 | |
81 | 78 | static void mac_get_model(char *str); |
79 | +static void mac_identify(void); | |
80 | +static void mac_report_hardware(void); | |
82 | 81 | |
83 | 82 | static void __init mac_sched_init(irq_handler_t vector) |
84 | 83 | { |
... | ... | @@ -765,7 +764,7 @@ |
765 | 764 | } |
766 | 765 | }; |
767 | 766 | |
768 | -void __init mac_identify(void) | |
767 | +static void __init mac_identify(void) | |
769 | 768 | { |
770 | 769 | struct mac_model *m; |
771 | 770 | |
... | ... | @@ -821,7 +820,7 @@ |
821 | 820 | baboon_init(); |
822 | 821 | } |
823 | 822 | |
824 | -void __init mac_report_hardware(void) | |
823 | +static void __init mac_report_hardware(void) | |
825 | 824 | { |
826 | 825 | printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name); |
827 | 826 | } |
arch/m68k/mac/debug.c
... | ... | @@ -51,6 +51,8 @@ |
51 | 51 | static int peng, line; |
52 | 52 | #endif |
53 | 53 | |
54 | +#if 0 | |
55 | + | |
54 | 56 | void mac_debugging_short(int pos, short num) |
55 | 57 | { |
56 | 58 | #ifdef DEBUG_SCREEN |
... | ... | @@ -125,6 +127,8 @@ |
125 | 127 | #endif |
126 | 128 | } |
127 | 129 | |
130 | +#endif /* 0 */ | |
131 | + | |
128 | 132 | #ifdef DEBUG_SERIAL |
129 | 133 | /* |
130 | 134 | * TODO: serial debug code |
... | ... | @@ -142,12 +146,6 @@ |
142 | 146 | |
143 | 147 | # define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase)) |
144 | 148 | |
145 | -/* Flag that serial port is already initialized and used */ | |
146 | -int mac_SCC_init_done; | |
147 | -/* Can be set somewhere, if a SCC master reset has already be done and should | |
148 | - * not be repeated; used by kgdb */ | |
149 | -int mac_SCC_reset_done; | |
150 | - | |
151 | 149 | static int scc_port = -1; |
152 | 150 | |
153 | 151 | static struct console mac_console_driver = { |
... | ... | @@ -171,8 +169,8 @@ |
171 | 169 | * this driver if Mac. |
172 | 170 | */ |
173 | 171 | |
174 | -void mac_debug_console_write(struct console *co, const char *str, | |
175 | - unsigned int count) | |
172 | +static void mac_debug_console_write(struct console *co, const char *str, | |
173 | + unsigned int count) | |
176 | 174 | { |
177 | 175 | mac_serial_print(str); |
178 | 176 | } |
... | ... | @@ -209,8 +207,8 @@ |
209 | 207 | scc.cha_a_data = c; |
210 | 208 | } |
211 | 209 | |
212 | -void mac_sccb_console_write(struct console *co, const char *str, | |
213 | - unsigned int count) | |
210 | +static void mac_sccb_console_write(struct console *co, const char *str, | |
211 | + unsigned int count) | |
214 | 212 | { |
215 | 213 | while (count--) { |
216 | 214 | if (*str == '\n') |
... | ... | @@ -219,8 +217,8 @@ |
219 | 217 | } |
220 | 218 | } |
221 | 219 | |
222 | -void mac_scca_console_write(struct console *co, const char *str, | |
223 | - unsigned int count) | |
220 | +static void mac_scca_console_write(struct console *co, const char *str, | |
221 | + unsigned int count) | |
224 | 222 | { |
225 | 223 | while (count--) { |
226 | 224 | if (*str == '\n') |
227 | 225 | |
228 | 226 | |
... | ... | @@ -265,14 +263,8 @@ |
265 | 263 | barrier(); \ |
266 | 264 | } while(0) |
267 | 265 | |
268 | -#ifndef CONFIG_SERIAL_CONSOLE | |
269 | 266 | static void __init mac_init_scc_port(int cflag, int port) |
270 | -#else | |
271 | -void mac_init_scc_port(int cflag, int port) | |
272 | -#endif | |
273 | 267 | { |
274 | - extern int mac_SCC_reset_done; | |
275 | - | |
276 | 268 | /* |
277 | 269 | * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k |
278 | 270 | */ |
279 | 271 | |
... | ... | @@ -340,21 +332,8 @@ |
340 | 332 | SCCA_WRITE(3, reg3 | 1); |
341 | 333 | SCCA_WRITE(5, reg5 | 8); |
342 | 334 | } |
343 | - | |
344 | - mac_SCC_reset_done = 1; | |
345 | - mac_SCC_init_done = 1; | |
346 | 335 | } |
347 | 336 | #endif /* DEBUG_SERIAL */ |
348 | - | |
349 | -void mac_init_scca_port(int cflag) | |
350 | -{ | |
351 | - mac_init_scc_port(cflag, 0); | |
352 | -} | |
353 | - | |
354 | -void mac_init_sccb_port(int cflag) | |
355 | -{ | |
356 | - mac_init_scc_port(cflag, 1); | |
357 | -} | |
358 | 337 | |
359 | 338 | static int __init mac_debug_setup(char *arg) |
360 | 339 | { |
arch/m68k/mac/oss.c
... | ... | @@ -30,8 +30,8 @@ |
30 | 30 | int oss_present; |
31 | 31 | volatile struct mac_oss *oss; |
32 | 32 | |
33 | -irqreturn_t oss_irq(int, void *); | |
34 | -irqreturn_t oss_nubus_irq(int, void *); | |
33 | +static irqreturn_t oss_irq(int, void *); | |
34 | +static irqreturn_t oss_nubus_irq(int, void *); | |
35 | 35 | |
36 | 36 | extern irqreturn_t via1_irq(int, void *); |
37 | 37 | extern irqreturn_t mac_scc_dispatch(int, void *); |
... | ... | @@ -92,7 +92,7 @@ |
92 | 92 | * and SCSI; everything else is routed to its own autovector IRQ. |
93 | 93 | */ |
94 | 94 | |
95 | -irqreturn_t oss_irq(int irq, void *dev_id) | |
95 | +static irqreturn_t oss_irq(int irq, void *dev_id) | |
96 | 96 | { |
97 | 97 | int events; |
98 | 98 | |
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | * Unlike the VIA/RBV this is on its own autovector interrupt level. |
127 | 127 | */ |
128 | 128 | |
129 | -irqreturn_t oss_nubus_irq(int irq, void *dev_id) | |
129 | +static irqreturn_t oss_nubus_irq(int irq, void *dev_id) | |
130 | 130 | { |
131 | 131 | int events, irq_bit, i; |
132 | 132 |
arch/m68k/mac/psc.c
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | * Debugging dump, used in various places to see what's going on. |
37 | 37 | */ |
38 | 38 | |
39 | -void psc_debug_dump(void) | |
39 | +static void psc_debug_dump(void) | |
40 | 40 | { |
41 | 41 | int i; |
42 | 42 | |
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | * expanded to cover what I think are the other 7 channels. |
56 | 56 | */ |
57 | 57 | |
58 | -void psc_dma_die_die_die(void) | |
58 | +static void psc_dma_die_die_die(void) | |
59 | 59 | { |
60 | 60 | int i; |
61 | 61 |
arch/m68k/mac/via.c
include/asm-m68k/mac_baboon.h
include/asm-m68k/mac_via.h
include/asm-m68k/macintosh.h
... | ... | @@ -12,17 +12,12 @@ |
12 | 12 | extern void mac_poweroff(void); |
13 | 13 | extern void mac_init_IRQ(void); |
14 | 14 | extern int mac_irq_pending(unsigned int); |
15 | -extern void mac_identify(void); | |
16 | -extern void mac_report_hardware(void); | |
17 | 15 | |
18 | 16 | /* |
19 | 17 | * Floppy driver magic hook - probably shouldnt be here |
20 | 18 | */ |
21 | 19 | |
22 | 20 | extern void via1_set_head(int); |
23 | - | |
24 | -extern void parse_booter(char *ptr); | |
25 | -extern void print_booter(char *ptr); | |
26 | 21 | |
27 | 22 | /* |
28 | 23 | * Macintosh Table |