]> git.hungrycats.org Git - linux/commitdiff
[PATCH] #if versus #ifdef cleanup
authorAndrew Morton <akpm@osdl.org>
Wed, 18 Feb 2004 12:50:10 +0000 (04:50 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 18 Feb 2004 12:50:10 +0000 (04:50 -0800)
From: Valdis.Kletnieks@vt.edu

15 changes of #if to #ifdef and 2 places CONFIG_FOO should be
defined(CONFIG_FOO).  This gets rid of spurious warnings if you build with
"-Wundef" so you get a warning if you have a preprocessor command like:

#if CONFIG_ETRAX_DS1302_RSTBIT == 27

and you'll be told if it's substituting a zero rather than silent
weirdness and unexpected code generation.

13 files changed:
arch/ia64/sn/kernel/irq.c
drivers/char/mem.c
drivers/mtd/maps/solutionengine.c
drivers/net/depca.c
drivers/net/tulip/de4x5.c
include/asm-i386/module.h
include/asm-mips/hardirq.h
include/asm-mips/pgtable-32.h
include/asm-mips/topology.h
include/asm-sh/hardirq.h
include/asm-sh/kmap_types.h
lib/crc32.c
net/ipv6/af_inet6.c

index aab72b0e1579bcdb4cac8d3cc4cc425d2b2e76e7..1bb46bcc531701290c021f0add3ca0066129998e 100644 (file)
@@ -121,7 +121,7 @@ sn_end_irq(unsigned int irq)
 static void
 sn_set_affinity_irq(unsigned int irq, unsigned long cpu)
 {
-#if CONFIG_SMP
+#ifdef CONFIG_SMP
        int redir = 0;
        struct sn_intr_list_t *p = sn_intr_list[irq];
        pcibr_intr_t intr;
index 98d2ba2cb112654a947ab08397571117596d1e3d..c14f274b2822af360361e438aa9cbad5a08d259d 100644 (file)
@@ -11,8 +11,6 @@
 #include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
-#include <linux/tpqic02.h>
-#include <linux/ftape.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mman.h>
index 5804c996ba941bb5ab26c4ff1053f11a21fe21e5..ea2b7af95daebcc76c1a2db0466589d1d37a551f 100644 (file)
@@ -97,7 +97,7 @@ static int __init init_soleng_maps(void)
 
        nr_parts = parse_mtd_partitions(flash_mtd, probes, &parsed_parts, 0);
 
-#if CONFIG_MTD_SUPERH_RESERVE
+#ifdef CONFIG_MTD_SUPERH_RESERVE
        if (nr_parts <= 0) {
                printk(KERN_NOTICE "Using configured partition at 0x%08x.\n",
                       CONFIG_MTD_SUPERH_RESERVE);
index bf90df1a358902c275261869a1d4513118e3b7d7..80e8617dcb2c3e0cac6cef9e99e457fc3cfe8de3 100644 (file)
@@ -2086,7 +2086,7 @@ static int __init depca_module_init (void)
 {
         int err = 0;
 
-#if CONFIG_MCA
+#ifdef CONFIG_MCA
         err = mca_register_driver (&depca_mca_driver);
 #endif
 #ifdef CONFIG_EISA
@@ -2101,7 +2101,7 @@ static int __init depca_module_init (void)
 static void __exit depca_module_exit (void)
 {
        int i;
-#if CONFIG_MCA
+#ifdef CONFIG_MCA
         mca_unregister_driver (&depca_mca_driver);
 #endif
 #ifdef CONFIG_EISA
index ad5af029ba506f79b7f4c59a9a73721615b3a11e..78ee02e1945141b1125d368fe11a78ff3a4c14ff 100644 (file)
@@ -5745,7 +5745,7 @@ static int __init de4x5_module_init (void)
 {
        int err = 0;
 
-#if CONFIG_PCI
+#ifdef CONFIG_PCI
        err = pci_module_init (&de4x5_pci_driver);
 #endif
 #ifdef CONFIG_EISA
@@ -5757,7 +5757,7 @@ static int __init de4x5_module_init (void)
 
 static void __exit de4x5_module_exit (void)
 {
-#if CONFIG_PCI
+#ifdef CONFIG_PCI
        pci_unregister_driver (&de4x5_pci_driver);
 #endif
 #ifdef CONFIG_EISA
index 8a5536c5f247d9472f54039a6a7738cfcf6af5e7..14ea6eb3f298f89428a97a77097a88c4ed3d1c24 100644 (file)
@@ -48,7 +48,7 @@ struct mod_arch_specific
 #define MODULE_PROC_FAMILY "WINCHIP3D "
 #elif defined CONFIG_MCYRIXIII
 #define MODULE_PROC_FAMILY "CYRIXIII "
-#elif CONFIG_MVIAC3_2
+#elif defined CONFIG_MVIAC3_2
 #define MODULE_PROC_FAMILY "VIAC3-2 "
 #else
 #error unknown processor family
index b6fa5ddc8ffde411082b18074815bdc42465eb92..6f5f9a35dbe66ddb24193ede96b8b34075ce0e36 100644 (file)
@@ -79,7 +79,7 @@ typedef struct {
 
 #define irq_enter()            (preempt_count() += HARDIRQ_OFFSET)
 
-#if CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT
 # define in_atomic()   (preempt_count() != kernel_locked())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
 #else
index c2dcefb10392706d6dcf3d21d8668f4a4b031034..8914882f4ab9ec6a6409ebfd030b539a009e8998 100644 (file)
@@ -80,7 +80,7 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
 
 #define VMALLOC_START     KSEG2
 
-#if CONFIG_HIGHMEM
+#ifdef CONFIG_HIGHMEM
 # define VMALLOC_END   (PKMAP_BASE-2*PAGE_SIZE)
 #else
 # define VMALLOC_END   (FIXADDR_START-2*PAGE_SIZE)
index b383688c4ead9fdf7a9081b6344917333f29a4e5..8e85e624367f1c268c1ad9186ac4511973e23faa 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __ASM_TOPOLOGY_H
 #define __ASM_TOPOLOGY_H
 
-#if CONFIG_SGI_IP27
+#ifdef CONFIG_SGI_IP27
 
 #include <asm/mmzone.h>
 
index 62aacd1313b6a4f8f60b90384c84fae3700bb899..a57b94d22ecaa651db6080fd253084394c0ed85e 100644 (file)
@@ -74,7 +74,7 @@ typedef struct {
 #define nmi_enter()            (irq_enter())
 #define nmi_exit()             (preempt_count() -= HARDIRQ_OFFSET)
 
-#if CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT
 # define in_atomic()   ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
 #else
index 0afcdb74a9973dc3316fd61fe22ea96704fe03d9..2492ba07148f672a1c2224f51f1608dc91b48462 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <linux/config.h>
 
-#if CONFIG_DEBUG_HIGHMEM
+#ifdef CONFIG_DEBUG_HIGHMEM
 # define D(n) __KM_FENCE_##n ,
 #else
 # define D(n)
index 2783fa38af65c1d63072126256a3532062c71fe3..5c3292f8da844c75333c4ba17053c7ce16261fda 100644 (file)
@@ -397,7 +397,7 @@ EXPORT_SYMBOL(bitreverse);
  * the same way on decoding, it doesn't make a difference.
  */
 
-#if UNITTEST
+#ifdef UNITTEST
 
 #include <stdlib.h>
 #include <stdio.h>
index 2a3e8c942b3351ffd7fa8a64bf1b8cd2d80d9062..9eedd751ce26b28b48349edb1e65bf83d00f7e3a 100644 (file)
@@ -56,7 +56,7 @@
 #include <net/transp_v6.h>
 #include <net/ip6_route.h>
 #include <net/addrconf.h>
-#if CONFIG_IPV6_TUNNEL
+#ifdef CONFIG_IPV6_TUNNEL
 #include <net/ip6_tunnel.h>
 #endif