Commit c65febbb authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] #if versus #ifdef cleanup

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.
parent b7df53b3
......@@ -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;
......
......@@ -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>
......
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
#ifndef __ASM_TOPOLOGY_H
#define __ASM_TOPOLOGY_H
#if CONFIG_SGI_IP27
#ifdef CONFIG_SGI_IP27
#include <asm/mmzone.h>
......
......@@ -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
......
......@@ -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)
......
......@@ -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>
......
......@@ -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
......
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