From f9b07897c6288d7e5fc1fd004fccb0c5f1a0e570 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sat, 8 Jan 2011 21:57:48 +0100 Subject: m68k: Uninline strchr() Some versions of gcc replace calls to strstr() with single-character "needle" string parameters by calls to strchr() behind our back. If strchr() is defined as an inline function, this causes linking errors like ERROR: "strchr" [drivers/target/target_core_mod.ko] undefined! As m68k is the only architecture that has an inline strchr() and this inline version is not an optimized asm version, uninline strchr() and use the standard out-of-line C version in lib/string.c instead. This also decreases the defconfig/allmodconfig kernel image sizes by a few hundred bytes. Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/string.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'arch') diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index 2936dda..65b1312 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h @@ -81,18 +81,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n) strcpy(__d + strlen(__d), (s)); \ }) -#define __HAVE_ARCH_STRCHR -static inline char *strchr(const char *s, int c) -{ - char sc, ch = c; - - for (; (sc = *s++) != ch; ) { - if (!sc) - return NULL; - } - return (char *)s - 1; -} - #ifndef CONFIG_COLDFIRE #define __HAVE_ARCH_STRCMP static inline int strcmp(const char *cs, const char *ct) -- cgit v1.1 From de339e4b792aed799bec23251e83f594ac44ae04 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 16 Jan 2011 20:47:47 +0100 Subject: m68k/atari: Rename "scc" to "atari_scc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's a way too generic name for a global #define and conflicts with a variable with the same name, causing build errors like: | drivers/staging/brcm80211/brcmfmac/../util/siutils.c: In function ‘_si_clkctl_cc’: | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1364: error: expected identifier or ‘(’ before ‘volatile’ | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1364: error: expected ‘)’ before ‘(’ token | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1421: error: incompatible types in assignment | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1422: error: invalid operands to binary & | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1423: error: invalid operands to binary & | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1424: error: invalid operands to binary | | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: aggregate value used where an integer was expected | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1425: error: incompatible type for argument 4 of ‘bcmsdh_reg_write’ | drivers/staging/brcm80211/brcmfmac/../util/siutils.c:1428: error: invalid operands to binary & | make[8]: *** [drivers/staging/brcm80211/brcmfmac/../util/siutils.o] Error 1 Signed-off-by: Geert Uytterhoeven --- arch/m68k/atari/ataints.c | 4 ++-- arch/m68k/atari/config.c | 2 +- arch/m68k/atari/debug.c | 14 +++++++------- arch/m68k/include/asm/atarihw.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'arch') diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 39478dd..26a804e 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -388,9 +388,9 @@ void __init atari_init_IRQ(void) } if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) { - scc.cha_a_ctrl = 9; + atari_scc.cha_a_ctrl = 9; MFPDELAY(); - scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */ + atari_scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */ } if (ATARIHW_PRESENT(SCU)) { diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index ae2d96e..4203d10 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -315,7 +315,7 @@ void __init config_atari(void) ATARIHW_SET(SCC_DMA); printk("SCC_DMA "); } - if (scc_test(&scc.cha_a_ctrl)) { + if (scc_test(&atari_scc.cha_a_ctrl)) { ATARIHW_SET(SCC); printk("SCC "); } diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index 28efdc3..5a48424 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c @@ -53,9 +53,9 @@ static inline void ata_scc_out(char c) { do { MFPDELAY(); - } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ + } while (!(atari_scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ MFPDELAY(); - scc.cha_b_data = c; + atari_scc.cha_b_data = c; } static void atari_scc_console_write(struct console *co, const char *str, @@ -140,9 +140,9 @@ int atari_scc_console_wait_key(struct console *co) { do { MFPDELAY(); - } while (!(scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */ + } while (!(atari_scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */ MFPDELAY(); - return scc.cha_b_data; + return atari_scc.cha_b_data; } int atari_midi_console_wait_key(struct console *co) @@ -185,9 +185,9 @@ static void __init atari_init_mfp_port(int cflag) #define SCC_WRITE(reg, val) \ do { \ - scc.cha_b_ctrl = (reg); \ + atari_scc.cha_b_ctrl = (reg); \ MFPDELAY(); \ - scc.cha_b_ctrl = (val); \ + atari_scc.cha_b_ctrl = (val); \ MFPDELAY(); \ } while (0) @@ -240,7 +240,7 @@ static void __init atari_init_scc_port(int cflag) reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40; reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */; - (void)scc.cha_b_ctrl; /* reset reg pointer */ + (void)atari_scc.cha_b_ctrl; /* reset reg pointer */ SCC_WRITE(9, 0xc0); /* reset */ LONG_DELAY(); /* extra delay after WR9 access */ SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h index a714e1a..f51f709 100644 --- a/arch/m68k/include/asm/atarihw.h +++ b/arch/m68k/include/asm/atarihw.h @@ -449,7 +449,7 @@ struct SCC u_char char_dummy3; u_char cha_b_data; }; -# define scc ((*(volatile struct SCC*)SCC_BAS)) +# define atari_scc ((*(volatile struct SCC*)SCC_BAS)) /* The ESCC (Z85230) in an Atari ST. The channels are reversed! */ # define st_escc ((*(volatile struct SCC*)0xfffffa31)) -- cgit v1.1 From 5df1abdbd37af2ae317a1c5b5944173284dc55d6 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 7 Jan 2011 13:25:29 +0100 Subject: m68k/amiga: Fix "debug=mem" `debug=mem' on Amiga has been broken for a while. early_param() processing is done very/too early, i.e. before amiga_identify() / amiga_chip_init(), causing amiga_savekmsg_setup() not to find any Chip RAM. As we don't plan to free this memory anyway, just steal it from the initial Chip RAM memory block instead. Signed-off-by: Geert Uytterhoeven --- arch/m68k/amiga/config.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'arch') diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index b1577f7..82a4bb5 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -610,17 +610,17 @@ static void amiga_mem_console_write(struct console *co, const char *s, static int __init amiga_savekmsg_setup(char *arg) { - static struct resource debug_res = { .name = "Debug" }; - if (!MACH_IS_AMIGA || strcmp(arg, "mem")) - goto done; + return 0; - if (!AMIGAHW_PRESENT(CHIP_RAM)) { - printk("Warning: no chipram present for debugging\n"); - goto done; + if (amiga_chip_size < SAVEKMSG_MAXMEM) { + pr_err("Not enough chipram for debugging\n"); + return -ENOMEM; } - savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res); + /* Just steal the block, the chipram allocator isn't functional yet */ + amiga_chip_size -= SAVEKMSG_MAXMEM; + savekmsg = (void *)ZTWO_VADDR(CHIP_PHYSADDR + amiga_chip_size); savekmsg->magic1 = SAVEKMSG_MAGIC1; savekmsg->magic2 = SAVEKMSG_MAGIC2; savekmsg->magicptr = ZTWO_PADDR(savekmsg); @@ -628,8 +628,6 @@ static int __init amiga_savekmsg_setup(char *arg) amiga_console_driver.write = amiga_mem_console_write; register_console(&amiga_console_driver); - -done: return 0; } -- cgit v1.1