Skip to content

Commit

Permalink
m68k/mac/: possible cleanups
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AdrianBunk authored and torvalds committed Jul 21, 2008
1 parent 5575d0a commit 8dfbdf4
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 189 deletions.
2 changes: 1 addition & 1 deletion arch/m68k/mac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 12 additions & 14 deletions arch/m68k/mac/baboon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
122 changes: 0 additions & 122 deletions arch/m68k/mac/bootparse.c

This file was deleted.

11 changes: 5 additions & 6 deletions arch/m68k/mac/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand All @@ -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);
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
41 changes: 10 additions & 31 deletions arch/m68k/mac/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -125,6 +127,8 @@ void mac_debugging_long(int pos, long addr)
#endif
}

#endif /* 0 */

#ifdef DEBUG_SERIAL
/*
* TODO: serial debug code
Expand All @@ -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 = {
Expand All @@ -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);
}
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions arch/m68k/mac/oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/mac/psc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/mac/via.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions include/asm-m68k/mac_baboon.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@ struct baboon {
*/
};

extern volatile struct baboon *baboon;

#endif /* __ASSEMBLY **/
Loading

0 comments on commit 8dfbdf4

Please sign in to comment.