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

Commit d559d4a2 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds
Browse files

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: default avatarIvan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ede42692
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -74,6 +74,8 @@
# define DBG(args)
# define DBG(args)
#endif
#endif


DEFINE_SPINLOCK(t2_hae_lock);

static volatile unsigned int t2_mcheck_any_expected;
static volatile unsigned int t2_mcheck_any_expected;
static volatile unsigned int t2_mcheck_last_taken;
static volatile unsigned int t2_mcheck_last_taken;


+2 −1
Original line number Original line Diff line number Diff line
@@ -447,7 +447,7 @@ struct unaligned_stat {




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




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


	unaligned[0].count++;
	unaligned[0].count++;
+1 −1
Original line number Original line Diff line number Diff line
@@ -261,7 +261,7 @@ struct el_MCPCIA_uncorrected_frame_mcheck {
	}
	}
#endif
#endif


static inline int __mcpcia_is_mmio(unsigned long addr)
extern inline int __mcpcia_is_mmio(unsigned long addr)
{
{
	return (addr & 0x80000000UL) == 0;
	return (addr & 0x80000000UL) == 0;
}
}
+7 −7
Original line number Original line Diff line number Diff line
@@ -356,13 +356,13 @@ struct el_t2_frame_corrected {
#define vip	volatile int *
#define vip	volatile int *
#define vuip	volatile unsigned int *
#define vuip	volatile unsigned int *


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


static inline void t2_outb(u8 b, unsigned long addr)
extern inline void t2_outb(u8 b, unsigned long addr)
{
{
	unsigned long w;
	unsigned long w;


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


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


static inline void t2_outw(u16 b, unsigned long addr)
extern inline void t2_outw(u16 b, unsigned long addr)
{
{
	unsigned long w;
	unsigned long w;


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


static inline u32 t2_inl(unsigned long addr)
extern inline u32 t2_inl(unsigned long addr)
{
{
	return *(vuip) ((addr << 5) + T2_IO + 0x18);
	return *(vuip) ((addr << 5) + T2_IO + 0x18);
}
}


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


static DEFINE_SPINLOCK(t2_hae_lock);
extern spinlock_t t2_hae_lock;


/*
/*
 * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
 * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
+3 −3
Original line number Original line Diff line number Diff line
@@ -35,7 +35,7 @@
 * register not being up-to-date with respect to the hardware
 * register not being up-to-date with respect to the hardware
 * value.
 * value.
 */
 */
static inline void __set_hae(unsigned long new_hae)
extern inline void __set_hae(unsigned long new_hae)
{
{
	unsigned long flags;
	unsigned long flags;
	local_irq_save(flags);
	local_irq_save(flags);
@@ -49,7 +49,7 @@ static inline void __set_hae(unsigned long new_hae)
	local_irq_restore(flags);
	local_irq_restore(flags);
}
}


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


static inline void __iomem *generic_ioportmap(unsigned long a)
extern inline void __iomem *generic_ioportmap(unsigned long a)
{
{
	return alpha_mv.mv_ioportmap(a);
	return alpha_mv.mv_ioportmap(a);
}
}
Loading