Skip to content

Commit

Permalink
[PATCH] turn many #if $undefined_string into #ifdef $undefined_string
Browse files Browse the repository at this point in the history
turn many #if $undefined_string into #ifdef $undefined_string to fix some
warnings after -Wno-def was added to global CFLAGS

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
olafhering authored and Linus Torvalds committed Jul 27, 2005
1 parent 02b7756 commit 44456d3
Show file tree
Hide file tree
Showing 38 changed files with 81 additions and 74 deletions.
2 changes: 1 addition & 1 deletion arch/ppc64/kernel/udbg.c
Expand Up @@ -141,7 +141,7 @@ void udbg_init_scc(struct device_node *np)

#endif /* CONFIG_PPC_PMAC */

#if CONFIG_PPC_PMAC
#ifdef CONFIG_PPC_PMAC
static void udbg_real_putc(unsigned char c)
{
while ((real_readb(sccc) & SCC_TXRDY) == 0)
Expand Down
4 changes: 2 additions & 2 deletions arch/um/drivers/cow.h
Expand Up @@ -3,10 +3,10 @@

#include <asm/types.h>

#if __BYTE_ORDER == __BIG_ENDIAN
#if defined(__BIG_ENDIAN)
# define ntohll(x) (x)
# define htonll(x) (x)
#elif __BYTE_ORDER == __LITTLE_ENDIAN
#elif defined(__LITTLE_ENDIAN)
# define ntohll(x) bswap_64(x)
# define htonll(x) bswap_64(x)
#else
Expand Down
4 changes: 2 additions & 2 deletions arch/um/kernel/skas/syscall_user.c
Expand Up @@ -15,7 +15,7 @@
void handle_syscall(union uml_pt_regs *regs)
{
long result;
#if UML_CONFIG_SYSCALL_DEBUG
#ifdef UML_CONFIG_SYSCALL_DEBUG
int index;

index = record_syscall_start(UPT_SYSCALL_NR(regs));
Expand All @@ -27,7 +27,7 @@ void handle_syscall(union uml_pt_regs *regs)
REGS_SET_SYSCALL_RETURN(regs->skas.regs, result);

syscall_trace(regs, 1);
#if UML_CONFIG_SYSCALL_DEBUG
#ifdef UML_CONFIG_SYSCALL_DEBUG
record_syscall_end(index, result);
#endif
}
Expand Down
1 change: 1 addition & 0 deletions arch/um/os-Linux/elf_aux.c
Expand Up @@ -11,6 +11,7 @@
#include <stddef.h>
#include "init.h"
#include "elf_user.h"
#include <asm/elf.h>

#if ELF_CLASS == ELFCLASS32
typedef Elf32_auxv_t elf_auxv_t;
Expand Down
6 changes: 3 additions & 3 deletions arch/x86_64/ia32/ia32_aout.c
Expand Up @@ -42,7 +42,7 @@ extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout_library(struct file*);

#if CORE_DUMP
#ifdef CORE_DUMP
static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);

/*
Expand Down Expand Up @@ -103,7 +103,7 @@ static struct linux_binfmt aout_format = {
.module = THIS_MODULE,
.load_binary = load_aout_binary,
.load_shlib = load_aout_library,
#if CORE_DUMP
#ifdef CORE_DUMP
.core_dump = aout_core_dump,
#endif
.min_coredump = PAGE_SIZE
Expand All @@ -120,7 +120,7 @@ static void set_brk(unsigned long start, unsigned long end)
up_write(&current->mm->mmap_sem);
}

#if CORE_DUMP
#ifdef CORE_DUMP
/*
* These are the only things you should do on a core-file: use only these
* macros to write out all the necessary info.
Expand Down
10 changes: 5 additions & 5 deletions arch/x86_64/kernel/smpboot.c
Expand Up @@ -285,7 +285,7 @@ static __cpuinit void sync_tsc(void)
int i, done = 0;
long delta, adj, adjust_latency = 0;
unsigned long flags, rt, master_time_stamp, bound;
#if DEBUG_TSC_SYNC
#ifdef DEBUG_TSC_SYNC
static struct syncdebug {
long rt; /* roundtrip time */
long master; /* master's timestamp */
Expand Down Expand Up @@ -321,7 +321,7 @@ static __cpuinit void sync_tsc(void)
rdtscll(t);
wrmsrl(MSR_IA32_TSC, t + adj);
}
#if DEBUG_TSC_SYNC
#ifdef DEBUG_TSC_SYNC
t[i].rt = rt;
t[i].master = master_time_stamp;
t[i].diff = delta;
Expand All @@ -331,7 +331,7 @@ static __cpuinit void sync_tsc(void)
}
spin_unlock_irqrestore(&tsc_sync_lock, flags);

#if DEBUG_TSC_SYNC
#ifdef DEBUG_TSC_SYNC
for (i = 0; i < NUM_ROUNDS; ++i)
printk("rt=%5ld master=%5ld diff=%5ld adjlat=%5ld\n",
t[i].rt, t[i].master, t[i].diff, t[i].lat);
Expand Down Expand Up @@ -537,7 +537,7 @@ void __cpuinit start_secondary(void)
extern volatile unsigned long init_rsp;
extern void (*initial_code)(void);

#if APIC_DEBUG
#ifdef APIC_DEBUG
static void inquire_remote_apic(int apicid)
{
unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
Expand Down Expand Up @@ -841,7 +841,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
else
/* trampoline code not run */
printk("Not responding.\n");
#if APIC_DEBUG
#ifdef APIC_DEBUG
inquire_remote_apic(apicid);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/sx8.c
Expand Up @@ -1582,7 +1582,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
goto err_out;

#if IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */
#ifdef IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */
rc = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
if (!rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
Expand All @@ -1601,7 +1601,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_regions;
}
pci_dac = 0;
#if IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */
#ifdef IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */
}
#endif

Expand Down
8 changes: 4 additions & 4 deletions drivers/cdrom/mcdx.c
Expand Up @@ -51,7 +51,7 @@
*/


#if RCS
#ifdef RCS
static const char *mcdx_c_version
= "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $";
#endif
Expand Down Expand Up @@ -706,7 +706,7 @@ static int mcdx_open(struct cdrom_device_info *cdi, int purpose)
xtrace(OPENCLOSE, "open() init irq generation\n");
if (-1 == mcdx_config(stuffp, 1))
return -EIO;
#if FALLBACK
#ifdef FALLBACK
/* Set the read speed */
xwarn("AAA %x AAA\n", stuffp->readcmd);
if (stuffp->readerrs)
Expand Down Expand Up @@ -1216,7 +1216,7 @@ static int __init mcdx_init_drive(int drive)
}


#if WE_KNOW_WHY
#ifdef WE_KNOW_WHY
/* irq 11 -> channel register */
outb(0x50, stuffp->wreg_chn);
#endif
Expand Down Expand Up @@ -1294,7 +1294,7 @@ static int mcdx_transfer(struct s_drive_stuff *stuffp,

ans = mcdx_xfer(stuffp, p, sector, nr_sectors);
return ans;
#if FALLBACK
#ifdef FALLBACK
if (-1 == ans)
stuffp->readerrs++;
else
Expand Down
12 changes: 6 additions & 6 deletions drivers/char/rio/rioboot.c
Expand Up @@ -902,7 +902,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st
(HostP->Mapping[entry].RtaUniqueNum==RtaUniq))
{
HostP->Mapping[entry].Flags |= RTA_BOOTED|RTA_NEWBOOT;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(HostP->svFlags[entry]);
#endif
if ( (sysport=HostP->Mapping[entry].SysPort) != NO_PORT )
Expand All @@ -918,7 +918,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st
{
entry2 = HostP->Mapping[entry].ID2 - 1;
HostP->Mapping[entry2].Flags |= RTA_BOOTED|RTA_NEWBOOT;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(HostP->svFlags[entry2]);
#endif
sysport = HostP->Mapping[entry2].SysPort;
Expand Down Expand Up @@ -1143,7 +1143,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st
CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN );
HostP->Mapping[entry].Flags =
SLOT_IN_USE | RTA_BOOTED | RTA_NEWBOOT;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(HostP->svFlags[entry]);
#endif
RIOReMapPorts( p, HostP, &HostP->Mapping[entry] );
Expand All @@ -1159,7 +1159,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st
"This RTA has a tentative entry on another host - delete that entry (1)\n");
HostP->Mapping[entry].Flags =
SLOT_TENTATIVE | RTA_BOOTED | RTA_NEWBOOT;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(HostP->svFlags[entry]);
#endif
}
Expand All @@ -1169,7 +1169,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st
{
HostP->Mapping[entry2].Flags = SLOT_IN_USE |
RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(HostP->svFlags[entry2]);
#endif
HostP->Mapping[entry2].SysPort = MapP2->SysPort;
Expand All @@ -1188,7 +1188,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st
else
HostP->Mapping[entry2].Flags = SLOT_TENTATIVE |
RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(HostP->svFlags[entry2]);
#endif
bzero( (caddr_t)MapP2, sizeof(struct Map) );
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/rio/rioroute.c
Expand Up @@ -1023,7 +1023,7 @@ RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit)
if (link < LINKS_PER_UNIT)
return 1;

#if NEED_TO_FIX_THIS
#ifdef NEED_TO_FIX_THIS
/* Ok so all the links are disconnected. But we may have only just
** made this slot tentative and not yet received a topology update.
** Lets check how long ago we made it tentative.
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/rio/riotable.c
Expand Up @@ -771,7 +771,7 @@ int RIOAssignRta( struct rio_info *p, struct Map *MapP )
if ((MapP->Flags & RTA16_SECOND_SLOT) == 0)
CCOPY( MapP->Name, HostMapP->Name, MAX_NAME_LEN );
HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED;
#if NEED_TO_FIX
#ifdef NEED_TO_FIX
RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID-1]);
#endif
if (MapP->Flags & RTA16_SECOND_SLOT)
Expand Down
1 change: 1 addition & 0 deletions drivers/ieee1394/sbp2.c
Expand Up @@ -169,6 +169,7 @@ MODULE_DEVICE_TABLE(ieee1394, sbp2_id_table);
* Debug levels, configured via kernel config, or enable here.
*/

#define CONFIG_IEEE1394_SBP2_DEBUG 0
/* #define CONFIG_IEEE1394_SBP2_DEBUG_ORBS */
/* #define CONFIG_IEEE1394_SBP2_DEBUG_DMA */
/* #define CONFIG_IEEE1394_SBP2_DEBUG 1 */
Expand Down
8 changes: 4 additions & 4 deletions drivers/isdn/hisax/l3dss1.c
Expand Up @@ -353,7 +353,7 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc,
{ l3dss1_dummy_invoke(st, cr, id, ident, p, nlen);
return;
}
#if HISAX_DE_AOC
#ifdef HISAX_DE_AOC
{

#define FOO1(s,a,b) \
Expand Down Expand Up @@ -977,7 +977,7 @@ l3dss1_release_cmpl(struct l3_process *pc, u_char pr, void *arg)
dss1_release_l3_process(pc);
}

#if EXT_BEARER_CAPS
#ifdef EXT_BEARER_CAPS

static u_char *
EncodeASyncParams(u_char * p, u_char si2)
Expand Down Expand Up @@ -1369,7 +1369,7 @@ l3dss1_setup_req(struct l3_process *pc, u_char pr,
*p++ = *sub++ & 0x7f;
}
}
#if EXT_BEARER_CAPS
#ifdef EXT_BEARER_CAPS
if ((pc->para.setup.si2 >= 160) && (pc->para.setup.si2 <= 175)) { // sync. Bitratenadaption, V.110/X.30

*p++ = IE_LLC;
Expand Down Expand Up @@ -1609,7 +1609,7 @@ l3dss1_setup(struct l3_process *pc, u_char pr, void *arg)
case 0x08: /* Unrestricted digital information */
pc->para.setup.si1 = 7;
/* JIM, 05.11.97 I wanna set service indicator 2 */
#if EXT_BEARER_CAPS
#ifdef EXT_BEARER_CAPS
pc->para.setup.si2 = DecodeSI2(skb);
#endif
break;
Expand Down
8 changes: 4 additions & 4 deletions drivers/md/bitmap.c
Expand Up @@ -108,7 +108,7 @@ static unsigned char *bitmap_alloc_page(struct bitmap *bitmap)
{
unsigned char *page;

#if INJECT_FAULTS_1
#ifdef INJECT_FAULTS_1
page = NULL;
#else
page = kmalloc(PAGE_SIZE, GFP_NOIO);
Expand Down Expand Up @@ -843,7 +843,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, int in_sync)

BUG_ON(!file && !bitmap->offset);

#if INJECT_FAULTS_3
#ifdef INJECT_FAULTS_3
outofdate = 1;
#else
outofdate = bitmap->flags & BITMAP_STALE;
Expand Down Expand Up @@ -1187,7 +1187,7 @@ static int bitmap_start_daemon(struct bitmap *bitmap, mdk_thread_t **ptr,

spin_unlock_irqrestore(&bitmap->lock, flags);

#if INJECT_FATAL_FAULT_2
#ifdef INJECT_FATAL_FAULT_2
daemon = NULL;
#else
sprintf(namebuf, "%%s_%s", name);
Expand Down Expand Up @@ -1552,7 +1552,7 @@ int bitmap_create(mddev_t *mddev)

bitmap->syncchunk = ~0UL;

#if INJECT_FATAL_FAULT_1
#ifdef INJECT_FATAL_FAULT_1
bitmap->bp = NULL;
#else
bitmap->bp = kmalloc(pages * sizeof(*bitmap->bp), GFP_KERNEL);
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/devices/docecc.c
Expand Up @@ -40,6 +40,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/doc2000.h>

#define DEBUG 0
/* need to undef it (from asm/termbits.h) */
#undef B0

Expand Down
6 changes: 3 additions & 3 deletions drivers/net/8139too.c
Expand Up @@ -126,14 +126,14 @@
#define USE_IO_OPS 1
#endif

/* define to 1 to enable copious debugging info */
#undef RTL8139_DEBUG
/* define to 1, 2 or 3 to enable copious debugging info */
#define RTL8139_DEBUG 0

/* define to 1 to disable lightweight runtime debugging checks */
#undef RTL8139_NDEBUG


#ifdef RTL8139_DEBUG
#if RTL8139_DEBUG
/* note: prints function name for you */
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
#else
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/amd8111e.c
Expand Up @@ -1290,7 +1290,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *reg
writel(intr0, mmio + INT0);

/* Check if Receive Interrupt has occurred. */
#if CONFIG_AMD8111E_NAPI
#ifdef CONFIG_AMD8111E_NAPI
if(intr0 & RINT0){
if(netif_rx_schedule_prep(dev)){
/* Disable receive interupts */
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ne.c
Expand Up @@ -129,9 +129,9 @@ bad_clone_list[] __initdata = {
#define NESM_START_PG 0x40 /* First page of TX buffer */
#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */

#ifdef CONFIG_PLAT_MAPPI
#if defined(CONFIG_PLAT_MAPPI)
# define DCR_VAL 0x4b
#elif CONFIG_PLAT_OAKS32R
#elif defined(CONFIG_PLAT_OAKS32R)
# define DCR_VAL 0x48
#else
# define DCR_VAL 0x49
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/NCR53c406a.c
Expand Up @@ -182,13 +182,13 @@ static int irq_probe(void);
static void *bios_base;
#endif

#if PORT_BASE
#ifdef PORT_BASE
static int port_base = PORT_BASE;
#else
static int port_base;
#endif

#if IRQ_LEV
#ifdef IRQ_LEV
static int irq_level = IRQ_LEV;
#else
static int irq_level = -1; /* 0 is 'no irq', so use -1 for 'uninitialized' */
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/aic7xxx/aic79xx_osm.c
Expand Up @@ -1505,7 +1505,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
memset(recovery_cmd, 0, sizeof(struct scsi_cmnd));
recovery_cmd->device = cmd->device;
recovery_cmd->scsi_done = ahd_linux_dev_reset_complete;
#if AHD_DEBUG
#ifdef AHD_DEBUG
if ((ahd_debug & AHD_SHOW_RECOVERY) != 0)
printf("%s:%d:%d:%d: Device reset called for cmd %p\n",
ahd_name(ahd), cmd->device->channel, cmd->device->id,
Expand Down

0 comments on commit 44456d3

Please sign in to comment.