Commit 7807a1bc authored by Andrew Morton's avatar Andrew Morton Committed by Jens Axboe

[PATCH] Make the world safe for -Wundef

Patch from: Valdis.Kletnieks@vt.edu

This is a patch to clean things up so compiling with -Wundef becomes feasible
(This patch cuts the number of warnings with 'make allyesconfig' drop from
around 10,000 to several hundred).  It was originally inspired by the
discussion of things that include linux/version.h but don't use the contents
- after doing this, I was able to find that there *WAS* at least one place
where version.h was missing (see following patch).
parent ea36e1ce
......@@ -12,39 +12,39 @@ struct mod_arch_specific
#ifdef CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
#elif CONFIG_M486
#elif defined CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif CONFIG_M586
#elif defined CONFIG_M586
#define MODULE_PROC_FAMILY "586 "
#elif CONFIG_M586TSC
#elif defined CONFIG_M586TSC
#define MODULE_PROC_FAMILY "586TSC "
#elif CONFIG_M586MMX
#elif defined CONFIG_M586MMX
#define MODULE_PROC_FAMILY "586MMX "
#elif CONFIG_M686
#elif defined CONFIG_M686
#define MODULE_PROC_FAMILY "686 "
#elif CONFIG_MPENTIUMII
#elif defined CONFIG_MPENTIUMII
#define MODULE_PROC_FAMILY "PENTIUMII "
#elif CONFIG_MPENTIUMIII
#elif defined CONFIG_MPENTIUMIII
#define MODULE_PROC_FAMILY "PENTIUMIII "
#elif CONFIG_MPENTIUM4
#elif defined CONFIG_MPENTIUM4
#define MODULE_PROC_FAMILY "PENTIUM4 "
#elif CONFIG_MK6
#elif defined CONFIG_MK6
#define MODULE_PROC_FAMILY "K6 "
#elif CONFIG_MK7
#elif defined CONFIG_MK7
#define MODULE_PROC_FAMILY "K7 "
#elif CONFIG_MK8
#elif defined CONFIG_MK8
#define MODULE_PROC_FAMILY "K8 "
#elif CONFIG_MELAN
#elif defined CONFIG_MELAN
#define MODULE_PROC_FAMILY "ELAN "
#elif CONFIG_MCRUSOE
#elif defined CONFIG_MCRUSOE
#define MODULE_PROC_FAMILY "CRUSOE "
#elif CONFIG_MWINCHIPC6
#elif defined CONFIG_MWINCHIPC6
#define MODULE_PROC_FAMILY "WINCHIPC6 "
#elif CONFIG_MWINCHIP2
#elif defined CONFIG_MWINCHIP2
#define MODULE_PROC_FAMILY "WINCHIP2 "
#elif CONFIG_MWINCHIP3D
#elif defined CONFIG_MWINCHIP3D
#define MODULE_PROC_FAMILY "WINCHIP3D "
#elif CONFIG_MCYRIXIII
#elif defined CONFIG_MCYRIXIII
#define MODULE_PROC_FAMILY "CYRIXIII "
#elif CONFIG_MVIAC3_2
#define MODULE_PROC_FAMILY "VIAC3-2 "
......
......@@ -39,7 +39,7 @@
/*
* These are used to make use of C type-checking..
*/
#if CONFIG_X86_PAE
#ifdef CONFIG_X86_PAE
typedef struct { unsigned long pte_low, pte_high; } pte_t;
typedef struct { unsigned long long pmd; } pmd_t;
typedef struct { unsigned long long pgd; } pgd_t;
......
......@@ -39,7 +39,7 @@ extern unsigned long empty_zero_page[1024];
* newer 3-level PAE-mode page tables.
*/
#ifndef __ASSEMBLY__
#if CONFIG_X86_PAE
#ifdef CONFIG_X86_PAE
# include <asm/pgtable-3level.h>
#else
# include <asm/pgtable-2level.h>
......@@ -79,7 +79,7 @@ void pgtable_cache_init(void);
#define VMALLOC_START (((unsigned long) high_memory + 2*VMALLOC_OFFSET-1) & \
~(VMALLOC_OFFSET-1))
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#if CONFIG_HIGHMEM
#ifdef CONFIG_HIGHMEM
# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
#else
# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
......
......@@ -483,7 +483,7 @@ extern inline void prefetch(const void *x)
__asm__ __volatile__ ("prefetchnta (%0)" : : "r"(x));
}
#elif CONFIG_X86_USE_3DNOW
#elif defined CONFIG_X86_USE_3DNOW
#define ARCH_HAS_PREFETCH
#define ARCH_HAS_PREFETCHW
......
......@@ -45,12 +45,12 @@ struct semaphore {
atomic_t count;
int sleepers;
wait_queue_head_t wait;
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
long __magic;
#endif
};
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) \
, (int)&(name).__magic
#else
......@@ -81,7 +81,7 @@ static inline void sema_init (struct semaphore *sem, int val)
atomic_set(&sem->count, val);
sem->sleepers = 0;
init_waitqueue_head(&sem->wait);
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
sem->__magic = (int)&sem->__magic;
#endif
}
......@@ -113,7 +113,7 @@ asmlinkage void __up(struct semaphore * sem);
*/
static inline void down(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
might_sleep();
......@@ -139,7 +139,7 @@ static inline int down_interruptible(struct semaphore * sem)
{
int result;
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
might_sleep();
......@@ -167,7 +167,7 @@ static inline int down_trylock(struct semaphore * sem)
{
int result;
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
......@@ -195,7 +195,7 @@ static inline int down_trylock(struct semaphore * sem)
*/
static inline void up(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
__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