Commit e7f2954f authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: amd64 - #if abuse fixes

#if where #ifdef should've been.  Fixed.
parent 908d6d81
...@@ -57,7 +57,7 @@ sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, struct pt_regs re ...@@ -57,7 +57,7 @@ sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, struct pt_regs re
current->blocked = newset; current->blocked = newset;
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
#if DEBUG_SIG #ifdef DEBUG_SIG
printk("rt_sigsuspend savset(%lx) newset(%lx) regs(%p) rip(%lx)\n", printk("rt_sigsuspend savset(%lx) newset(%lx) regs(%p) rip(%lx)\n",
saveset, newset, &regs, regs.rip); saveset, newset, &regs, regs.rip);
#endif #endif
...@@ -158,7 +158,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs regs) ...@@ -158,7 +158,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs regs)
goto badframe; goto badframe;
} }
#if DEBUG_SIG #ifdef DEBUG_SIG
printk("%d sigreturn rip:%lx rsp:%lx frame:%p rax:%lx\n",current->pid,regs.rip,regs.rsp,frame,eax); printk("%d sigreturn rip:%lx rsp:%lx frame:%p rax:%lx\n",current->pid,regs.rip,regs.rsp,frame,eax);
#endif #endif
...@@ -295,7 +295,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -295,7 +295,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
goto give_sigsegv; goto give_sigsegv;
} }
#if DEBUG_SIG #ifdef DEBUG_SIG
printk("%d old rip %lx old rsp %lx old rax %lx\n", current->pid,regs->rip,regs->rsp,regs->rax); printk("%d old rip %lx old rsp %lx old rax %lx\n", current->pid,regs->rip,regs->rsp,regs->rax);
#endif #endif
...@@ -320,7 +320,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -320,7 +320,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
set_fs(USER_DS); set_fs(USER_DS);
regs->eflags &= ~TF_MASK; regs->eflags &= ~TF_MASK;
#if DEBUG_SIG #ifdef DEBUG_SIG
printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
current->comm, current->pid, frame, regs->rip, frame->pretcode); current->comm, current->pid, frame, regs->rip, frame->pretcode);
#endif #endif
...@@ -343,7 +343,7 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, ...@@ -343,7 +343,7 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
{ {
struct k_sigaction *ka = &current->sighand->action[sig-1]; struct k_sigaction *ka = &current->sighand->action[sig-1];
#if DEBUG_SIG #ifdef DEBUG_SIG
printk("handle_signal pid:%d sig:%lu rip:%lx rsp:%lx regs=%p\n", current->pid, sig, printk("handle_signal pid:%d sig:%lu rip:%lx rsp:%lx regs=%p\n", current->pid, sig,
regs->rip, regs->rsp, regs); regs->rip, regs->rsp, regs);
#endif #endif
...@@ -455,7 +455,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -455,7 +455,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, __u32 thread_info_flags) void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, __u32 thread_info_flags)
{ {
#if DEBUG_SIG #ifdef DEBUG_SIG
printk("do_notify_resume flags:%x rip:%lx rsp:%lx caller:%lx pending:%lx\n", printk("do_notify_resume flags:%x rip:%lx rsp:%lx caller:%lx pending:%lx\n",
thread_info_flags, regs->rip, regs->rsp, __builtin_return_address(0),signal_pending(current)); thread_info_flags, regs->rip, regs->rsp, __builtin_return_address(0),signal_pending(current));
#endif #endif
......
...@@ -47,12 +47,12 @@ struct semaphore { ...@@ -47,12 +47,12 @@ struct semaphore {
atomic_t count; atomic_t count;
int sleepers; int sleepers;
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) \
, (int)&(name).__magic , (int)&(name).__magic
#else #else
...@@ -83,7 +83,7 @@ static inline void sema_init (struct semaphore *sem, int val) ...@@ -83,7 +83,7 @@ static inline void sema_init (struct semaphore *sem, int val)
atomic_set(&sem->count, val); atomic_set(&sem->count, val);
sem->sleepers = 0; sem->sleepers = 0;
init_waitqueue_head(&sem->wait); init_waitqueue_head(&sem->wait);
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
sem->__magic = (int)&sem->__magic; sem->__magic = (int)&sem->__magic;
#endif #endif
} }
...@@ -115,7 +115,7 @@ asmlinkage void __up(struct semaphore * sem); ...@@ -115,7 +115,7 @@ asmlinkage void __up(struct semaphore * sem);
*/ */
static inline void down(struct semaphore * sem) static 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();
...@@ -142,7 +142,7 @@ static inline int down_interruptible(struct semaphore * sem) ...@@ -142,7 +142,7 @@ static inline int down_interruptible(struct semaphore * sem)
{ {
int result; int result;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -171,7 +171,7 @@ static inline int down_trylock(struct semaphore * sem) ...@@ -171,7 +171,7 @@ static inline int down_trylock(struct semaphore * sem)
{ {
int result; int result;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -199,7 +199,7 @@ static inline int down_trylock(struct semaphore * sem) ...@@ -199,7 +199,7 @@ static inline int down_trylock(struct semaphore * sem)
*/ */
static inline void up(struct semaphore * sem) static inline void up(struct semaphore * sem)
{ {
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
__asm__ __volatile__( __asm__ __volatile__(
......
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