1
0
Fork 0

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>
hifive-unleashed-5.1
Adrian Bunk 2008-07-17 21:16:25 +02:00 committed by Linus Torvalds
parent 5575d0a3c9
commit 8dfbdf4aba
11 changed files with 35 additions and 189 deletions

View File

@ -2,5 +2,5 @@
# Makefile for Linux arch/m68k/mac source directory
#
obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
obj-y := config.o macints.o iop.o via.o oss.o psc.o \
baboon.o macboing.o debug.o misc.o

View File

@ -23,9 +23,7 @@
/* #define DEBUG_IRQS */
int baboon_present;
volatile struct baboon *baboon;
irqreturn_t baboon_irq(int, void *);
static volatile struct baboon *baboon;
#if 0
extern int macide_ack_intr(struct ata_channel *);
@ -49,21 +47,11 @@ void __init baboon_init(void)
printk("Baboon detected at %p\n", baboon);
}
/*
* Register the Baboon interrupt dispatcher on nubus slot $C.
*/
void __init baboon_register_interrupts(void)
{
request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
"baboon", (void *) baboon);
}
/*
* Baboon interrupt handler. This works a lot like a VIA.
*/
irqreturn_t baboon_irq(int irq, void *dev_id)
static irqreturn_t baboon_irq(int irq, void *dev_id)
{
int irq_bit, irq_num;
unsigned char events;
@ -95,6 +83,16 @@ irqreturn_t baboon_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}
/*
* Register the Baboon interrupt dispatcher on nubus slot $C.
*/
void __init baboon_register_interrupts(void)
{
request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
"baboon", (void *) baboon);
}
void baboon_irq_enable(int irq) {
#ifdef DEBUG_IRQUSE
printk("baboon_irq_enable(%d)\n", irq);

View File

@ -1,122 +0,0 @@
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/bootinfo.h>
#include <asm/macintosh.h>
/*
* Booter vars
*/
int boothowto;
int _boothowto;
/*
* Called early to parse the environment (passed to us from the booter)
* into a bootinfo struct. Will die as soon as we have our own booter
*/
#define atol(x) simple_strtoul(x,NULL,0)
void parse_booter(char *env)
{
char *name;
char *value;
#if 0
while(0 && *env)
#else
while(*env)
#endif
{
name=env;
value=name;
while(*value!='='&&*value)
value++;
if(*value=='=')
*value++=0;
env=value;
while(*env)
env++;
env++;
#if 0
if(strcmp(name,"VIDEO_ADDR")==0)
mac_mch.videoaddr=atol(value);
if(strcmp(name,"ROW_BYTES")==0)
mac_mch.videorow=atol(value);
if(strcmp(name,"SCREEN_DEPTH")==0)
mac_mch.videodepth=atol(value);
if(strcmp(name,"DIMENSIONS")==0)
mac_mch.dimensions=atol(value);
#endif
if(strcmp(name,"BOOTTIME")==0)
mac_bi_data.boottime=atol(value);
if(strcmp(name,"GMTBIAS")==0)
mac_bi_data.gmtbias=atol(value);
if(strcmp(name,"BOOTERVER")==0)
mac_bi_data.bootver=atol(value);
if(strcmp(name,"MACOS_VIDEO")==0)
mac_bi_data.videological=atol(value);
if(strcmp(name,"MACOS_SCC")==0)
mac_bi_data.sccbase=atol(value);
if(strcmp(name,"MACHINEID")==0)
mac_bi_data.id=atol(value);
if(strcmp(name,"MEMSIZE")==0)
mac_bi_data.memsize=atol(value);
if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
mac_bi_data.serialmf=atol(value);
if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
mac_bi_data.serialhsk=atol(value);
if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
mac_bi_data.serialgpi=atol(value);
if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
mac_bi_data.printmf=atol(value);
if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
mac_bi_data.printhsk=atol(value);
if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
mac_bi_data.printgpi=atol(value);
if(strcmp(name,"PROCESSOR")==0)
mac_bi_data.cpuid=atol(value);
if(strcmp(name,"ROMBASE")==0)
mac_bi_data.rombase=atol(value);
if(strcmp(name,"TIMEDBRA")==0)
mac_bi_data.timedbra=atol(value);
if(strcmp(name,"ADBDELAY")==0)
mac_bi_data.adbdelay=atol(value);
}
#if 0 /* XXX: TODO with m68k_mach_* */
/* Fill in the base stuff */
boot_info.machtype=MACH_MAC;
/* Read this from the macinfo we got ! */
/* boot_info.cputype=CPU_68020|FPUB_68881;*/
/* boot_info.memory[0].addr=0;*/
/* boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
boot_info.num_memory=1; /* On a MacII */
boot_info.ramdisk_size=0; /* For now */
*boot_info.command_line=0;
#endif
}
void print_booter(char *env)
{
char *name;
char *value;
while(*env)
{
name=env;
value=name;
while(*value!='='&&*value)
value++;
if(*value=='=')
*value++=0;
env=value;
while(*env)
env++;
env++;
printk("%s=%s\n", name,value);
}
}

View File

@ -46,7 +46,6 @@
/* Mac bootinfo struct */
struct mac_booter_data mac_bi_data;
int mac_bisize = sizeof mac_bi_data;
/* New m68k bootinfo stuff and videobase */
@ -55,10 +54,8 @@ extern struct mem_info m68k_memory[NUM_MEMINFO];
extern struct mem_info m68k_ramdisk;
void *mac_env; /* Loaded by the boot asm */
/* The phys. video addr. - might be bogus on some machines */
unsigned long mac_orig_videoaddr;
static unsigned long mac_orig_videoaddr;
/* Mac specific timer functions */
extern unsigned long mac_gettimeoffset(void);
@ -79,6 +76,8 @@ extern void mac_mksound(unsigned int, unsigned int);
extern void nubus_sweep_video(void);
static void mac_get_model(char *str);
static void mac_identify(void);
static void mac_report_hardware(void);
static void __init mac_sched_init(irq_handler_t vector)
{
@ -765,7 +764,7 @@ static struct mac_model mac_data_table[] = {
}
};
void __init mac_identify(void)
static void __init mac_identify(void)
{
struct mac_model *m;
@ -821,7 +820,7 @@ void __init mac_identify(void)
baboon_init();
}
void __init mac_report_hardware(void)
static void __init mac_report_hardware(void)
{
printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
}

View File

@ -51,6 +51,8 @@ extern void mac_serial_print(const char *);
static int peng, line;
#endif
#if 0
void mac_debugging_short(int pos, short num)
{
#ifdef DEBUG_SCREEN
@ -125,6 +127,8 @@ void mac_debugging_long(int pos, long addr)
#endif
}
#endif /* 0 */
#ifdef DEBUG_SERIAL
/*
* TODO: serial debug code
@ -142,12 +146,6 @@ struct mac_SCC {
# define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase))
/* Flag that serial port is already initialized and used */
int mac_SCC_init_done;
/* Can be set somewhere, if a SCC master reset has already be done and should
* not be repeated; used by kgdb */
int mac_SCC_reset_done;
static int scc_port = -1;
static struct console mac_console_driver = {
@ -171,8 +169,8 @@ static struct console mac_console_driver = {
* this driver if Mac.
*/
void mac_debug_console_write(struct console *co, const char *str,
unsigned int count)
static void mac_debug_console_write(struct console *co, const char *str,
unsigned int count)
{
mac_serial_print(str);
}
@ -209,8 +207,8 @@ static inline void mac_scca_out(char c)
scc.cha_a_data = c;
}
void mac_sccb_console_write(struct console *co, const char *str,
unsigned int count)
static void mac_sccb_console_write(struct console *co, const char *str,
unsigned int count)
{
while (count--) {
if (*str == '\n')
@ -219,8 +217,8 @@ void mac_sccb_console_write(struct console *co, const char *str,
}
}
void mac_scca_console_write(struct console *co, const char *str,
unsigned int count)
static void mac_scca_console_write(struct console *co, const char *str,
unsigned int count)
{
while (count--) {
if (*str == '\n')
@ -265,14 +263,8 @@ void mac_scca_console_write(struct console *co, const char *str,
barrier(); \
} while(0)
#ifndef CONFIG_SERIAL_CONSOLE
static void __init mac_init_scc_port(int cflag, int port)
#else
void mac_init_scc_port(int cflag, int port)
#endif
{
extern int mac_SCC_reset_done;
/*
* baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k
*/
@ -340,22 +332,9 @@ void mac_init_scc_port(int cflag, int port)
SCCA_WRITE(3, reg3 | 1);
SCCA_WRITE(5, reg5 | 8);
}
mac_SCC_reset_done = 1;
mac_SCC_init_done = 1;
}
#endif /* DEBUG_SERIAL */
void mac_init_scca_port(int cflag)
{
mac_init_scc_port(cflag, 0);
}
void mac_init_sccb_port(int cflag)
{
mac_init_scc_port(cflag, 1);
}
static int __init mac_debug_setup(char *arg)
{
if (!MACH_IS_MAC)

View File

@ -30,8 +30,8 @@
int oss_present;
volatile struct mac_oss *oss;
irqreturn_t oss_irq(int, void *);
irqreturn_t oss_nubus_irq(int, void *);
static irqreturn_t oss_irq(int, void *);
static irqreturn_t oss_nubus_irq(int, void *);
extern irqreturn_t via1_irq(int, void *);
extern irqreturn_t mac_scc_dispatch(int, void *);
@ -92,7 +92,7 @@ void __init oss_nubus_init(void)
* and SCSI; everything else is routed to its own autovector IRQ.
*/
irqreturn_t oss_irq(int irq, void *dev_id)
static irqreturn_t oss_irq(int irq, void *dev_id)
{
int events;
@ -126,7 +126,7 @@ irqreturn_t oss_irq(int irq, void *dev_id)
* Unlike the VIA/RBV this is on its own autovector interrupt level.
*/
irqreturn_t oss_nubus_irq(int irq, void *dev_id)
static irqreturn_t oss_nubus_irq(int irq, void *dev_id)
{
int events, irq_bit, i;

View File

@ -36,7 +36,7 @@ irqreturn_t psc_irq(int, void *);
* Debugging dump, used in various places to see what's going on.
*/
void psc_debug_dump(void)
static void psc_debug_dump(void)
{
int i;
@ -55,7 +55,7 @@ void psc_debug_dump(void)
* expanded to cover what I think are the other 7 channels.
*/
void psc_dma_die_die_die(void)
static void psc_dma_die_die_die(void)
{
int i;

View File

@ -45,7 +45,7 @@ volatile long *via_memory_bogon=(long *)&via_memory_bogon;
int rbv_present;
int via_alt_mapping;
EXPORT_SYMBOL(via_alt_mapping);
__u8 rbv_clear;
static __u8 rbv_clear;
/*
* Globals for accessing the VIA chip registers without having to

View File

@ -29,6 +29,4 @@ struct baboon {
*/
};
extern volatile struct baboon *baboon;
#endif /* __ASSEMBLY **/

View File

@ -253,7 +253,6 @@
extern volatile __u8 *via1,*via2;
extern int rbv_present,via_alt_mapping;
extern __u8 rbv_clear;
static inline int rbv_set_video_bpp(int bpp)
{

View File

@ -12,8 +12,6 @@ extern void mac_reset(void);
extern void mac_poweroff(void);
extern void mac_init_IRQ(void);
extern int mac_irq_pending(unsigned int);
extern void mac_identify(void);
extern void mac_report_hardware(void);
/*
* Floppy driver magic hook - probably shouldnt be here
@ -21,9 +19,6 @@ extern void mac_report_hardware(void);
extern void via1_set_head(int);
extern void parse_booter(char *ptr);
extern void print_booter(char *ptr);
/*
* Macintosh Table
*/