Skip to content

Commit d559d4a

Browse files
Ivan Kokshayskytorvalds
authored andcommitted
alpha: fix compile failures with gcc-4.3 (bug #10438)
Vast majority of these build failures are gcc-4.3 warnings about static functions and objects being referenced from non-static (read: "extern inline") functions, in conjunction with our -Werror. We cannot just convert "extern inline" to "static inline", as people keep suggesting all the time, because "extern inline" logic is crucial for generic kernel build. So - just make sure that all callees of critical "extern inline" functions are also "extern inline"; - use "static inline", wherever it's possible. traps.c: work around gcc-4.3 being too smart about array bounds-checking. TODO: add "gnu_inline" attribute to all our "extern inline" functions to ensure desired behaviour with future compilers. Signed-off-by: Ivan Kokshaysky <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ede4269 commit d559d4a

File tree

8 files changed

+26
-23
lines changed

8 files changed

+26
-23
lines changed

arch/alpha/kernel/core_t2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
# define DBG(args)
7575
#endif
7676

77+
DEFINE_SPINLOCK(t2_hae_lock);
78+
7779
static volatile unsigned int t2_mcheck_any_expected;
7880
static volatile unsigned int t2_mcheck_last_taken;
7981

arch/alpha/kernel/traps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ struct unaligned_stat {
447447

448448

449449
/* Macro for exception fixup code to access integer registers. */
450-
#define una_reg(r) (regs->regs[(r) >= 16 && (r) <= 18 ? (r)+19 : (r)])
450+
#define una_reg(r) (_regs[(r) >= 16 && (r) <= 18 ? (r)+19 : (r)])
451451

452452

453453
asmlinkage void
@@ -456,6 +456,7 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg,
456456
{
457457
long error, tmp1, tmp2, tmp3, tmp4;
458458
unsigned long pc = regs->pc - 4;
459+
unsigned long *_regs = regs->regs;
459460
const struct exception_table_entry *fixup;
460461

461462
unaligned[0].count++;

include/asm-alpha/core_mcpcia.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ struct el_MCPCIA_uncorrected_frame_mcheck {
261261
}
262262
#endif
263263

264-
static inline int __mcpcia_is_mmio(unsigned long addr)
264+
extern inline int __mcpcia_is_mmio(unsigned long addr)
265265
{
266266
return (addr & 0x80000000UL) == 0;
267267
}

include/asm-alpha/core_t2.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,13 @@ struct el_t2_frame_corrected {
356356
#define vip volatile int *
357357
#define vuip volatile unsigned int *
358358

359-
static inline u8 t2_inb(unsigned long addr)
359+
extern inline u8 t2_inb(unsigned long addr)
360360
{
361361
long result = *(vip) ((addr << 5) + T2_IO + 0x00);
362362
return __kernel_extbl(result, addr & 3);
363363
}
364364

365-
static inline void t2_outb(u8 b, unsigned long addr)
365+
extern inline void t2_outb(u8 b, unsigned long addr)
366366
{
367367
unsigned long w;
368368

@@ -371,13 +371,13 @@ static inline void t2_outb(u8 b, unsigned long addr)
371371
mb();
372372
}
373373

374-
static inline u16 t2_inw(unsigned long addr)
374+
extern inline u16 t2_inw(unsigned long addr)
375375
{
376376
long result = *(vip) ((addr << 5) + T2_IO + 0x08);
377377
return __kernel_extwl(result, addr & 3);
378378
}
379379

380-
static inline void t2_outw(u16 b, unsigned long addr)
380+
extern inline void t2_outw(u16 b, unsigned long addr)
381381
{
382382
unsigned long w;
383383

@@ -386,12 +386,12 @@ static inline void t2_outw(u16 b, unsigned long addr)
386386
mb();
387387
}
388388

389-
static inline u32 t2_inl(unsigned long addr)
389+
extern inline u32 t2_inl(unsigned long addr)
390390
{
391391
return *(vuip) ((addr << 5) + T2_IO + 0x18);
392392
}
393393

394-
static inline void t2_outl(u32 b, unsigned long addr)
394+
extern inline void t2_outl(u32 b, unsigned long addr)
395395
{
396396
*(vuip) ((addr << 5) + T2_IO + 0x18) = b;
397397
mb();
@@ -435,7 +435,7 @@ static inline void t2_outl(u32 b, unsigned long addr)
435435
set_hae(msb); \
436436
}
437437

438-
static DEFINE_SPINLOCK(t2_hae_lock);
438+
extern spinlock_t t2_hae_lock;
439439

440440
/*
441441
* NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since

include/asm-alpha/io.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* register not being up-to-date with respect to the hardware
3636
* value.
3737
*/
38-
static inline void __set_hae(unsigned long new_hae)
38+
extern inline void __set_hae(unsigned long new_hae)
3939
{
4040
unsigned long flags;
4141
local_irq_save(flags);
@@ -49,7 +49,7 @@ static inline void __set_hae(unsigned long new_hae)
4949
local_irq_restore(flags);
5050
}
5151

52-
static inline void set_hae(unsigned long new_hae)
52+
extern inline void set_hae(unsigned long new_hae)
5353
{
5454
if (new_hae != alpha_mv.hae_cache)
5555
__set_hae(new_hae);
@@ -176,7 +176,7 @@ REMAP2(u64, writeq, volatile)
176176
#undef REMAP1
177177
#undef REMAP2
178178

179-
static inline void __iomem *generic_ioportmap(unsigned long a)
179+
extern inline void __iomem *generic_ioportmap(unsigned long a)
180180
{
181181
return alpha_mv.mv_ioportmap(a);
182182
}

include/asm-alpha/mmu_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif
2424

2525

26-
extern inline unsigned long
26+
static inline unsigned long
2727
__reload_thread(struct pcb_struct *pcb)
2828
{
2929
register unsigned long a0 __asm__("$16");
@@ -114,7 +114,7 @@ extern unsigned long last_asn;
114114
#define __MMU_EXTERN_INLINE
115115
#endif
116116

117-
static inline unsigned long
117+
extern inline unsigned long
118118
__get_new_mm_context(struct mm_struct *mm, long cpu)
119119
{
120120
unsigned long asn = cpu_last_asn(cpu);
@@ -226,7 +226,7 @@ ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
226226
# endif
227227
#endif
228228

229-
extern inline int
229+
static inline int
230230
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
231231
{
232232
int i;

include/asm-alpha/system.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ enum amask_enum {
184184
__amask; })
185185

186186
#define __CALL_PAL_R0(NAME, TYPE) \
187-
static inline TYPE NAME(void) \
187+
extern inline TYPE NAME(void) \
188188
{ \
189189
register TYPE __r0 __asm__("$0"); \
190190
__asm__ __volatile__( \
@@ -196,7 +196,7 @@ static inline TYPE NAME(void) \
196196
}
197197

198198
#define __CALL_PAL_W1(NAME, TYPE0) \
199-
static inline void NAME(TYPE0 arg0) \
199+
extern inline void NAME(TYPE0 arg0) \
200200
{ \
201201
register TYPE0 __r16 __asm__("$16") = arg0; \
202202
__asm__ __volatile__( \
@@ -207,7 +207,7 @@ static inline void NAME(TYPE0 arg0) \
207207
}
208208

209209
#define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \
210-
static inline void NAME(TYPE0 arg0, TYPE1 arg1) \
210+
extern inline void NAME(TYPE0 arg0, TYPE1 arg1) \
211211
{ \
212212
register TYPE0 __r16 __asm__("$16") = arg0; \
213213
register TYPE1 __r17 __asm__("$17") = arg1; \
@@ -219,7 +219,7 @@ static inline void NAME(TYPE0 arg0, TYPE1 arg1) \
219219
}
220220

221221
#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \
222-
static inline RTYPE NAME(TYPE0 arg0) \
222+
extern inline RTYPE NAME(TYPE0 arg0) \
223223
{ \
224224
register RTYPE __r0 __asm__("$0"); \
225225
register TYPE0 __r16 __asm__("$16") = arg0; \
@@ -232,7 +232,7 @@ static inline RTYPE NAME(TYPE0 arg0) \
232232
}
233233

234234
#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \
235-
static inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \
235+
extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \
236236
{ \
237237
register RTYPE __r0 __asm__("$0"); \
238238
register TYPE0 __r16 __asm__("$16") = arg0; \

include/asm-alpha/vga.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
#define VT_BUF_HAVE_MEMSETW
1414
#define VT_BUF_HAVE_MEMCPYW
1515

16-
extern inline void scr_writew(u16 val, volatile u16 *addr)
16+
static inline void scr_writew(u16 val, volatile u16 *addr)
1717
{
1818
if (__is_ioaddr(addr))
1919
__raw_writew(val, (volatile u16 __iomem *) addr);
2020
else
2121
*addr = val;
2222
}
2323

24-
extern inline u16 scr_readw(volatile const u16 *addr)
24+
static inline u16 scr_readw(volatile const u16 *addr)
2525
{
2626
if (__is_ioaddr(addr))
2727
return __raw_readw((volatile const u16 __iomem *) addr);
2828
else
2929
return *addr;
3030
}
3131

32-
extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
32+
static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
3333
{
3434
if (__is_ioaddr(s))
3535
memsetw_io((u16 __iomem *) s, c, count);

0 commit comments

Comments
 (0)