Commit 20f36fc0 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] m68k sparse #if vs. #ifdef

M68k: Use #ifdef instead of #if (found by sparse)
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 49f5cae2
...@@ -349,7 +349,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, ...@@ -349,7 +349,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
/* /*
* user process trying to return with weird frame format * user process trying to return with weird frame format
*/ */
#if DEBUG #ifdef DEBUG
printk("user process returning with weird frame format\n"); printk("user process returning with weird frame format\n");
#endif #endif
goto badframe; goto badframe;
...@@ -450,7 +450,7 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, ...@@ -450,7 +450,7 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
/* /*
* user process trying to return with weird frame format * user process trying to return with weird frame format
*/ */
#if DEBUG #ifdef DEBUG
printk("user process returning with weird frame format\n"); printk("user process returning with weird frame format\n");
#endif #endif
goto badframe; goto badframe;
...@@ -829,7 +829,7 @@ static void setup_frame (int sig, struct k_sigaction *ka, ...@@ -829,7 +829,7 @@ static void setup_frame (int sig, struct k_sigaction *ka,
if (regs->stkadj) { if (regs->stkadj) {
struct pt_regs *tregs = struct pt_regs *tregs =
(struct pt_regs *)((ulong)regs + regs->stkadj); (struct pt_regs *)((ulong)regs + regs->stkadj);
#if DEBUG #ifdef DEBUG
printk("Performing stackadjust=%04x\n", regs->stkadj); printk("Performing stackadjust=%04x\n", regs->stkadj);
#endif #endif
/* This must be copied with decreasing addresses to /* This must be copied with decreasing addresses to
...@@ -912,7 +912,7 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -912,7 +912,7 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
if (regs->stkadj) { if (regs->stkadj) {
struct pt_regs *tregs = struct pt_regs *tregs =
(struct pt_regs *)((ulong)regs + regs->stkadj); (struct pt_regs *)((ulong)regs + regs->stkadj);
#if DEBUG #ifdef DEBUG
printk("Performing stackadjust=%04x\n", regs->stkadj); printk("Performing stackadjust=%04x\n", regs->stkadj);
#endif #endif
/* This must be copied with decreasing addresses to /* This must be copied with decreasing addresses to
......
...@@ -541,7 +541,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -541,7 +541,7 @@ static inline void bus_error030 (struct frame *fp)
unsigned short ssw = fp->un.fmtb.ssw; unsigned short ssw = fp->un.fmtb.ssw;
extern unsigned long _sun3_map_test_start, _sun3_map_test_end; extern unsigned long _sun3_map_test_start, _sun3_map_test_end;
#if DEBUG #ifdef DEBUG
if (ssw & (FC | FB)) if (ssw & (FC | FB))
printk ("Instruction fault at %#010lx\n", printk ("Instruction fault at %#010lx\n",
ssw & FC ? ssw & FC ?
...@@ -670,7 +670,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -670,7 +670,7 @@ static inline void bus_error030 (struct frame *fp)
unsigned short mmusr; unsigned short mmusr;
unsigned long addr, errorcode; unsigned long addr, errorcode;
unsigned short ssw = fp->un.fmtb.ssw; unsigned short ssw = fp->un.fmtb.ssw;
#if DEBUG #ifdef DEBUG
unsigned long desc; unsigned long desc;
printk ("pid = %x ", current->pid); printk ("pid = %x ", current->pid);
...@@ -696,7 +696,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -696,7 +696,7 @@ static inline void bus_error030 (struct frame *fp)
if (ssw & DF) { if (ssw & DF) {
addr = fp->un.fmtb.daddr; addr = fp->un.fmtb.daddr;
#if DEBUG #ifdef DEBUG
asm volatile ("ptestr %3,%2@,#7,%0\n\t" asm volatile ("ptestr %3,%2@,#7,%0\n\t"
"pmove %%psr,%1@" "pmove %%psr,%1@"
: "=a&" (desc) : "=a&" (desc)
...@@ -708,7 +708,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -708,7 +708,7 @@ static inline void bus_error030 (struct frame *fp)
#endif #endif
mmusr = temp; mmusr = temp;
#if DEBUG #ifdef DEBUG
printk("mmusr is %#x for addr %#lx in task %p\n", printk("mmusr is %#x for addr %#lx in task %p\n",
mmusr, addr, current); mmusr, addr, current);
printk("descriptor address is %#lx, contents %#lx\n", printk("descriptor address is %#lx, contents %#lx\n",
...@@ -767,7 +767,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -767,7 +767,7 @@ static inline void bus_error030 (struct frame *fp)
: "a" (&tlong)); : "a" (&tlong));
printk("tt1 is %#lx\n", tlong); printk("tt1 is %#lx\n", tlong);
#endif #endif
#if DEBUG #ifdef DEBUG
printk("Unknown SIGSEGV - 1\n"); printk("Unknown SIGSEGV - 1\n");
#endif #endif
die_if_kernel("Oops",&fp->ptregs,mmusr); die_if_kernel("Oops",&fp->ptregs,mmusr);
...@@ -812,7 +812,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -812,7 +812,7 @@ static inline void bus_error030 (struct frame *fp)
should still create the ATC entry. */ should still create the ATC entry. */
goto create_atc_entry; goto create_atc_entry;
#if DEBUG #ifdef DEBUG
asm volatile ("ptestr #1,%2@,#7,%0\n\t" asm volatile ("ptestr #1,%2@,#7,%0\n\t"
"pmove %%psr,%1@" "pmove %%psr,%1@"
: "=a&" (desc) : "=a&" (desc)
...@@ -836,7 +836,7 @@ static inline void bus_error030 (struct frame *fp) ...@@ -836,7 +836,7 @@ static inline void bus_error030 (struct frame *fp)
else if (mmusr & (MMU_B|MMU_L|MMU_S)) { else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
printk ("invalid insn access at %#lx from pc %#lx\n", printk ("invalid insn access at %#lx from pc %#lx\n",
addr, fp->ptregs.pc); addr, fp->ptregs.pc);
#if DEBUG #ifdef DEBUG
printk("Unknown SIGSEGV - 2\n"); printk("Unknown SIGSEGV - 2\n");
#endif #endif
die_if_kernel("Oops",&fp->ptregs,mmusr); die_if_kernel("Oops",&fp->ptregs,mmusr);
...@@ -858,7 +858,7 @@ asmlinkage void buserr_c(struct frame *fp) ...@@ -858,7 +858,7 @@ asmlinkage void buserr_c(struct frame *fp)
if (user_mode(&fp->ptregs)) if (user_mode(&fp->ptregs))
current->thread.esp0 = (unsigned long) fp; current->thread.esp0 = (unsigned long) fp;
#if DEBUG #ifdef DEBUG
printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format); printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format);
#endif #endif
...@@ -881,7 +881,7 @@ asmlinkage void buserr_c(struct frame *fp) ...@@ -881,7 +881,7 @@ asmlinkage void buserr_c(struct frame *fp)
#endif #endif
default: default:
die_if_kernel("bad frame format",&fp->ptregs,0); die_if_kernel("bad frame format",&fp->ptregs,0);
#if DEBUG #ifdef DEBUG
printk("Unknown SIGSEGV - 4\n"); printk("Unknown SIGSEGV - 4\n");
#endif #endif
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);
......
...@@ -129,7 +129,7 @@ int free_pointer_table (pmd_t *ptable) ...@@ -129,7 +129,7 @@ int free_pointer_table (pmd_t *ptable)
return 0; return 0;
} }
#if DEBUG_INVALID_PTOV #ifdef DEBUG_INVALID_PTOV
int mm_inv_cnt = 5; int mm_inv_cnt = 5;
#endif #endif
...@@ -179,7 +179,7 @@ unsigned long mm_ptov (unsigned long paddr) ...@@ -179,7 +179,7 @@ unsigned long mm_ptov (unsigned long paddr)
voff += m68k_memory[i].size; voff += m68k_memory[i].size;
} while (++i < m68k_num_memory); } while (++i < m68k_num_memory);
#if DEBUG_INVALID_PTOV #ifdef DEBUG_INVALID_PTOV
if (mm_inv_cnt > 0) { if (mm_inv_cnt > 0) {
mm_inv_cnt--; mm_inv_cnt--;
printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n", printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n",
......
...@@ -102,7 +102,7 @@ struct fp_data { ...@@ -102,7 +102,7 @@ struct fp_data {
struct fp_ext temp[2]; struct fp_ext temp[2];
}; };
#if FPU_EMU_DEBUG #ifdef FPU_EMU_DEBUG
extern unsigned int fp_debugprint; extern unsigned int fp_debugprint;
#define dprint(bit, fmt, args...) ({ \ #define dprint(bit, fmt, args...) ({ \
......
...@@ -27,12 +27,12 @@ struct semaphore { ...@@ -27,12 +27,12 @@ struct semaphore {
atomic_t count; atomic_t count;
atomic_t waking; atomic_t waking;
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
...@@ -86,7 +86,7 @@ static inline void down(struct semaphore *sem) ...@@ -86,7 +86,7 @@ static inline void down(struct semaphore *sem)
{ {
register struct semaphore *sem1 __asm__ ("%a1") = sem; register struct semaphore *sem1 __asm__ ("%a1") = sem;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -109,7 +109,7 @@ static inline int down_interruptible(struct semaphore *sem) ...@@ -109,7 +109,7 @@ static inline int down_interruptible(struct semaphore *sem)
register struct semaphore *sem1 __asm__ ("%a1") = sem; register struct semaphore *sem1 __asm__ ("%a1") = sem;
register int result __asm__ ("%d0"); register int result __asm__ ("%d0");
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -134,7 +134,7 @@ static inline int down_trylock(struct semaphore *sem) ...@@ -134,7 +134,7 @@ static inline int down_trylock(struct semaphore *sem)
register struct semaphore *sem1 __asm__ ("%a1") = sem; register struct semaphore *sem1 __asm__ ("%a1") = sem;
register int result __asm__ ("%d0"); register int result __asm__ ("%d0");
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -164,7 +164,7 @@ static inline void up(struct semaphore *sem) ...@@ -164,7 +164,7 @@ static inline void up(struct semaphore *sem)
{ {
register struct semaphore *sem1 __asm__ ("%a1") = sem; register struct semaphore *sem1 __asm__ ("%a1") = sem;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
......
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