Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8dfbdf4a authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds
Browse files

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: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5575d0a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+12 −14
Original line number Diff line number Diff line
@@ -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);

arch/m68k/mac/bootparse.c

deleted100644 → 0
+0 −122
Original line number Diff line number Diff line
#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);
	}
 }

+5 −6
Original line number Diff line number Diff line
@@ -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);
}
+10 −31
Original line number Diff line number Diff line
@@ -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,7 +169,7 @@ static struct console mac_console_driver = {
 * this driver if Mac.
 */

void mac_debug_console_write(struct console *co, const char *str,
static void mac_debug_console_write(struct console *co, const char *str,
				    unsigned int count)
{
	mac_serial_print(str);
@@ -209,7 +207,7 @@ static inline void mac_scca_out(char c)
	scc.cha_a_data = c;
}

void mac_sccb_console_write(struct console *co, const char *str,
static void mac_sccb_console_write(struct console *co, const char *str,
				   unsigned int count)
{
	while (count--) {
@@ -219,7 +217,7 @@ void mac_sccb_console_write(struct console *co, const char *str,
	}
}

void mac_scca_console_write(struct console *co, const char *str,
static void mac_scca_console_write(struct console *co, const char *str,
				   unsigned int count)
{
	while (count--) {
@@ -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)
Loading