Commit 9d0f5605 authored by Paul Mackerras's avatar Paul Mackerras

PPC32: Fix various minor problems pointed out by Linus' check program.

parent d1fc7b62
...@@ -99,7 +99,7 @@ EXPORT_SYMBOL(_prep_type); ...@@ -99,7 +99,7 @@ EXPORT_SYMBOL(_prep_type);
EXPORT_SYMBOL(ucSystemType); EXPORT_SYMBOL(ucSystemType);
#endif #endif
#if !__INLINE_BITOPS #if !defined(__INLINE_BITOPS)
EXPORT_SYMBOL(set_bit); EXPORT_SYMBOL(set_bit);
EXPORT_SYMBOL(clear_bit); EXPORT_SYMBOL(clear_bit);
EXPORT_SYMBOL(change_bit); EXPORT_SYMBOL(change_bit);
......
...@@ -205,7 +205,7 @@ struct task_struct *__switch_to(struct task_struct *prev, ...@@ -205,7 +205,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
struct task_struct *last; struct task_struct *last;
local_irq_save(s); local_irq_save(s);
#if CHECK_STACK #ifdef CHECK_STACK
check_stack(prev); check_stack(prev);
check_stack(new); check_stack(new);
#endif #endif
......
...@@ -476,7 +476,9 @@ static void __init printlargepacket(PnP_TAG_PACKET * pkt, int size) { ...@@ -476,7 +476,9 @@ static void __init printlargepacket(PnP_TAG_PACKET * pkt, int size) {
break; break;
} }
} }
static void __init printpackets(PnP_TAG_PACKET * pkt, const char * cat) {
static void __init printpackets(PnP_TAG_PACKET * pkt, const char * cat)
{
if (pkt->S1_Pack.Tag== END_TAG) { if (pkt->S1_Pack.Tag== END_TAG) {
printk(" No packets describing %s resources.\n", cat); printk(" No packets describing %s resources.\n", cat);
return; return;
...@@ -493,7 +495,7 @@ static void __init printpackets(PnP_TAG_PACKET * pkt, const char * cat) { ...@@ -493,7 +495,7 @@ static void __init printpackets(PnP_TAG_PACKET * pkt, const char * cat) {
size=tag_small_count(pkt->S1_Pack.Tag)+1; size=tag_small_count(pkt->S1_Pack.Tag)+1;
printsmallpacket(pkt, size); printsmallpacket(pkt, size);
} }
(unsigned char *) pkt+=size; pkt = (PnP_TAG_PACKET *)((unsigned char *) pkt + size);
} while (pkt->S1_Pack.Tag != END_TAG); } while (pkt->S1_Pack.Tag != END_TAG);
} }
......
...@@ -464,7 +464,7 @@ relocate_nodes(void) ...@@ -464,7 +464,7 @@ relocate_nodes(void)
struct device_node *np; struct device_node *np;
struct property *pp; struct property *pp;
#define ADDBASE(x) (x = (x)? ((typeof (x))((unsigned long)(x) + base)): 0) #define ADDBASE(x) (x = (typeof (x))((x)? ((unsigned long)(x) + base): 0))
base = (unsigned long) boot_infos + boot_infos->deviceTreeOffset; base = (unsigned long) boot_infos + boot_infos->deviceTreeOffset;
allnodes = (struct device_node *)(base + 4); allnodes = (struct device_node *)(base + 4);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <asm/xmon.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/bootx.h> #include <asm/bootx.h>
#include <asm/machdep.h> #include <asm/machdep.h>
...@@ -397,7 +398,7 @@ static unsigned char scc_inittab[] = { ...@@ -397,7 +398,7 @@ static unsigned char scc_inittab[] = {
}; };
void void
xmon_init_scc() xmon_init_scc(void)
{ {
if ( _machine == _MACH_chrp ) if ( _machine == _MACH_chrp )
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <asm/irq.h>
/* The __last_jiffy_stamp field is needed to ensure that no decrementer /* The __last_jiffy_stamp field is needed to ensure that no decrementer
* interrupt is lost on SMP machines. Since on most CPUs it is in the same * interrupt is lost on SMP machines. Since on most CPUs it is in the same
......
...@@ -57,7 +57,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, ...@@ -57,7 +57,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk,
#define LAST_CONTEXT 15 #define LAST_CONTEXT 15
#define FIRST_CONTEXT 0 #define FIRST_CONTEXT 0
#elif CONFIG_4xx #elif defined(CONFIG_4xx)
#define NO_CONTEXT 256 #define NO_CONTEXT 256
#define LAST_CONTEXT 255 #define LAST_CONTEXT 255
#define FIRST_CONTEXT 1 #define FIRST_CONTEXT 1
......
...@@ -89,7 +89,7 @@ typedef enum _OSAREA_USAGE { ...@@ -89,7 +89,7 @@ typedef enum _OSAREA_USAGE {
typedef enum _PM_MODE { typedef enum _PM_MODE {
Suspend = 0x80, /* Part of state is in memory */ Suspend = 0x80, /* Part of state is in memory */
Normal = 0x00 /* No power management in effect */ Normal = 0x00 /* No power management in effect */
} PMMode; } PMMODE;
typedef struct _HEADER { typedef struct _HEADER {
unsigned short Size; /* NVRAM size in K(1024) */ unsigned short Size; /* NVRAM size in K(1024) */
......
...@@ -691,8 +691,10 @@ struct thread_struct { ...@@ -691,8 +691,10 @@ struct thread_struct {
unsigned long fpscr_pad; /* fpr ... fpscr must be contiguous */ unsigned long fpscr_pad; /* fpr ... fpscr must be contiguous */
unsigned long fpscr; /* Floating point status */ unsigned long fpscr; /* Floating point status */
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
vector128 vr[32]; /* Complete AltiVec set */ /* Complete AltiVec register set */
vector128 vscr; /* AltiVec status */ vector128 vr[32] __attribute((aligned(16)));
/* AltiVec status */
vector128 vscr __attribute((aligned(16)));
unsigned long vrsave; unsigned long vrsave;
#endif /* CONFIG_ALTIVEC */ #endif /* CONFIG_ALTIVEC */
}; };
......
...@@ -29,12 +29,12 @@ struct semaphore { ...@@ -29,12 +29,12 @@ struct semaphore {
*/ */
atomic_t count; atomic_t count;
wait_queue_head_t wait; wait_queue_head_t wait;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
long __magic; long __magic;
#endif #endif
}; };
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) \ # define __SEM_DEBUG_INIT(name) \
, (long)&(name).__magic , (long)&(name).__magic
#else #else
...@@ -59,7 +59,7 @@ static inline void sema_init (struct semaphore *sem, int val) ...@@ -59,7 +59,7 @@ static inline void sema_init (struct semaphore *sem, int val)
{ {
atomic_set(&sem->count, val); atomic_set(&sem->count, val);
init_waitqueue_head(&sem->wait); init_waitqueue_head(&sem->wait);
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
sem->__magic = (long)&sem->__magic; sem->__magic = (long)&sem->__magic;
#endif #endif
} }
...@@ -80,7 +80,7 @@ extern void __up(struct semaphore * sem); ...@@ -80,7 +80,7 @@ extern void __up(struct semaphore * sem);
extern inline void down(struct semaphore * sem) extern inline void down(struct semaphore * sem)
{ {
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -97,7 +97,7 @@ extern inline int down_interruptible(struct semaphore * sem) ...@@ -97,7 +97,7 @@ extern inline int down_interruptible(struct semaphore * sem)
{ {
int ret = 0; int ret = 0;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -112,7 +112,7 @@ extern inline int down_trylock(struct semaphore * sem) ...@@ -112,7 +112,7 @@ extern inline int down_trylock(struct semaphore * sem)
{ {
int ret; int ret;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -123,7 +123,7 @@ extern inline int down_trylock(struct semaphore * sem) ...@@ -123,7 +123,7 @@ extern inline int down_trylock(struct semaphore * sem)
extern inline void up(struct semaphore * sem) extern inline void up(struct semaphore * sem)
{ {
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
......
...@@ -19,7 +19,7 @@ typedef unsigned long long __u64; ...@@ -19,7 +19,7 @@ typedef unsigned long long __u64;
typedef struct { typedef struct {
__u32 u[4]; __u32 u[4];
} __attribute((aligned(16))) __vector128; } __vector128;
/* /*
* XXX allowed outside of __KERNEL__ for now, until glibc gets * XXX allowed outside of __KERNEL__ for now, until glibc gets
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment