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). asm-i386/module.h | 34 +++++++++++++++++----------------- asm-i386/page.h | 2 +- asm-i386/pgtable.h | 4 ++-- asm-i386/processor.h | 2 +- asm-i386/semaphore.h | 14 +++++++------- 5 files changed, 28 insertions(+), 28 deletions(-) diff -puN include/asm-i386/module.h~fix-Wundef include/asm-i386/module.h --- 25/include/asm-i386/module.h~fix-Wundef 2003-02-14 18:24:10.000000000 -0800 +++ 25-akpm/include/asm-i386/module.h 2003-02-14 18:24:10.000000000 -0800 @@ -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 " diff -puN include/asm-i386/page.h~fix-Wundef include/asm-i386/page.h --- 25/include/asm-i386/page.h~fix-Wundef 2003-02-14 18:24:10.000000000 -0800 +++ 25-akpm/include/asm-i386/page.h 2003-02-14 18:24:10.000000000 -0800 @@ -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; diff -puN include/asm-i386/pgtable.h~fix-Wundef include/asm-i386/pgtable.h --- 25/include/asm-i386/pgtable.h~fix-Wundef 2003-02-14 18:24:10.000000000 -0800 +++ 25-akpm/include/asm-i386/pgtable.h 2003-02-14 18:24:10.000000000 -0800 @@ -39,7 +39,7 @@ extern unsigned long empty_zero_page[102 * newer 3-level PAE-mode page tables. */ #ifndef __ASSEMBLY__ -#if CONFIG_X86_PAE +#ifdef CONFIG_X86_PAE # include #else # include @@ -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) diff -puN include/asm-i386/processor.h~fix-Wundef include/asm-i386/processor.h --- 25/include/asm-i386/processor.h~fix-Wundef 2003-02-14 18:24:10.000000000 -0800 +++ 25-akpm/include/asm-i386/processor.h 2003-02-14 18:24:10.000000000 -0800 @@ -483,7 +483,7 @@ extern inline void prefetch(const void * __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 diff -puN include/asm-i386/semaphore.h~fix-Wundef include/asm-i386/semaphore.h --- 25/include/asm-i386/semaphore.h~fix-Wundef 2003-02-14 18:24:10.000000000 -0800 +++ 25-akpm/include/asm-i386/semaphore.h 2003-02-14 18:24:10.000000000 -0800 @@ -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 sem 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 * */ 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(str { 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 se { int result; -#if WAITQUEUE_DEBUG +#ifdef WAITQUEUE_DEBUG CHECK_MAGIC(sem->__magic); #endif @@ -195,7 +195,7 @@ static inline int down_trylock(struct se */ static inline void up(struct semaphore * sem) { -#if WAITQUEUE_DEBUG +#ifdef WAITQUEUE_DEBUG CHECK_MAGIC(sem->__magic); #endif __asm__ __volatile__( _