Fix uninitialized variable warnings

This commit is contained in:
christos 2003-10-25 18:40:37 +00:00
parent e5d9888ff1
commit 65235b9eb5
8 changed files with 105 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.540 2003/10/08 00:28:41 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.541 2003/10/25 18:40:37 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.540 2003/10/08 00:28:41 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.541 2003/10/25 18:40:37 christos Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -1723,7 +1723,7 @@ init386(first_avail)
* Steal memory for the message buffer (at end of core).
*/
{
struct vm_physseg *vps;
struct vm_physseg *vps = NULL;
psize_t sz = round_page(MSGBUFSIZE);
psize_t reqsz = sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: procfs_machdep.c,v 1.15 2003/06/29 22:28:26 fvdl Exp $ */
/* $NetBSD: procfs_machdep.c,v 1.16 2003/10/25 18:40:37 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15 2003/06/29 22:28:26 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.16 2003/10/25 18:40:37 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -83,6 +83,9 @@ procfs_getcpuinfstr(char *buf, int *len)
if (cpu_info_list->ci_tsc_freq != 0) {
freq = (cpu_info_list->ci_tsc_freq + 4999) / 1000000;
fraq = ((cpu_info_list->ci_tsc_freq + 4999) / 10000) % 100;
} else {
freq = 0; /* XXX: gcc */
fraq = 0;
}
p = featurebuf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.189 2003/10/08 00:28:41 thorpej Exp $ */
/* $NetBSD: trap.c,v 1.190 2003/10/25 18:40:37 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.189 2003/10/08 00:28:41 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.190 2003/10/25 18:40:37 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -220,9 +220,9 @@ trap(frame)
resume_iret[], resume_pop_ds[], resume_pop_es[],
resume_pop_fs[], resume_pop_gs[],
IDTVEC(osyscall)[];
struct trapframe *vframe;
struct trapframe *vframe = NULL;
ksiginfo_t ksi;
int resume;
int resume = 0;
caddr_t onfault;
int error;
uint32_t cr2;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm86.c,v 1.34 2003/10/08 00:28:41 thorpej Exp $ */
/* $NetBSD: vm86.c,v 1.35 2003/10/25 18:40:37 christos Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm86.c,v 1.34 2003/10/08 00:28:41 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm86.c,v 1.35 2003/10/25 18:40:37 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -96,7 +96,7 @@ static __inline int is_bitset __P((int, caddr_t));
#define getword(base, ptr, word) \
do { \
u_long w1, w2; \
u_long w1 = 0, w2 = 0; /* XXX: gcc */\
getbyte(base, ptr, w1); \
getbyte(base, ptr, w2); \
word = w1 | w2 << 8; \
@ -104,7 +104,7 @@ static __inline int is_bitset __P((int, caddr_t));
#define getdword(base, ptr, dword) \
do { \
u_long w1, w2; \
u_long w1 = 0, w2 = 0; /* XXX: gcc */\
getword(base, ptr, w1); \
getword(base, ptr, w2); \
dword = w1 | w2 << 16; \

View File

@ -1,4 +1,4 @@
/* $NetBSD: elan520.c,v 1.5 2003/04/01 20:55:54 thorpej Exp $ */
/* $NetBSD: elan520.c,v 1.6 2003/10/25 18:40:58 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -47,7 +47,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: elan520.c,v 1.5 2003/04/01 20:55:54 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: elan520.c,v 1.6 2003/10/25 18:40:58 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -79,7 +79,7 @@ static void
elansc_wdogctl_write(struct elansc_softc *sc, uint16_t val)
{
int s;
uint8_t echo_mode;
uint8_t echo_mode = 0; /* XXX: gcc */
s = splhigh();

View File

@ -1,4 +1,4 @@
/* $NetBSD: pchb.c,v 1.46 2003/08/28 10:58:37 tron Exp $ */
/* $NetBSD: pchb.c,v 1.47 2003/10/25 18:40:58 christos Exp $ */
/*-
* Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.46 2003/08/28 10:58:37 tron Exp $");
__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.47 2003/10/25 18:40:58 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -111,7 +111,7 @@ pchbattach(struct device *parent, struct device *self, void *aux)
struct pcibus_attach_args pba;
struct agpbus_attach_args apa;
pcireg_t bcreg;
u_char bdnum, pbnum;
u_char bdnum, pbnum = 0;
pcitag_t tag;
int doattach, attachflags, has_agp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_intr_fixup.c,v 1.25 2003/10/13 05:19:19 dyoung Exp $ */
/* $NetBSD: pci_intr_fixup.c,v 1.26 2003/10/25 18:40:58 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci_intr_fixup.c,v 1.25 2003/10/13 05:19:19 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci_intr_fixup.c,v 1.26 2003/10/25 18:40:58 christos Exp $");
#include "opt_pcibios.h"
@ -574,13 +574,45 @@ pciintr_irq_release(pciirq)
u_int16_t *pciirq;
{
int i, bit;
u_int16_t bios_pciirq;
int reg;
#ifdef PCIINTR_DEBUG
printf("pciintr_irq_release: fixup pciirq level/edge map 0x%04x\n",
*pciirq);
#endif
/* Get bios level/edge setting. */
bios_pciirq = 0;
for (i = 0, bit = 1; i < 16; i++, bit <<= 1) {
(void)pciintr_icu_get_trigger(pciintr_icu_tag,
pciintr_icu_handle, i, &reg);
if (reg == IST_LEVEL)
bios_pciirq |= bit;
}
#ifdef PCIINTR_DEBUG
printf("pciintr_irq_release: bios pciirq level/edge map 0x%04x\n",
bios_pciirq);
#endif /* PCIINTR_DEBUG */
/* fixup final level/edge setting. */
*pciirq |= bios_pciirq;
for (i = 0, bit = 1; i < 16; i++, bit <<= 1) {
if ((*pciirq & bit) == 0)
(void) pciintr_icu_set_trigger(pciintr_icu_tag,
pciintr_icu_handle, i, IST_EDGE);
reg = IST_EDGE;
else
reg = IST_LEVEL;
(void) pciintr_icu_set_trigger(pciintr_icu_tag,
pciintr_icu_handle, i, reg);
}
#ifdef PCIINTR_DEBUG
printf("pciintr_irq_release: final pciirq level/edge map 0x%04x\n",
*pciirq);
#endif /* PCIINTR_DEBUG */
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcibios.c,v 1.12 2003/09/17 11:57:34 drochner Exp $ */
/* $NetBSD: pcibios.c,v 1.13 2003/10/25 18:40:58 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcibios.c,v 1.12 2003/09/17 11:57:34 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcibios.c,v 1.13 2003/10/25 18:40:58 christos Exp $");
#include "opt_pcibios.h"
@ -119,6 +119,19 @@ int pcibios_get_intr_routing __P((struct pcibios_intr_routing *,
int pcibios_return_code __P((u_int16_t, const char *));
void pcibios_print_exclirq __P((void));
/* for Libretto L2/L3 hack */
void pcibios_fixup_pir_table __P((void));
void pcibios_fixup_pir_table_mask __P((struct pcibios_linkmap *));
struct pcibios_linkmap pir_mask[] = {
{ 2, 0x0040 },
{ 7, 0x0080 },
{ 8, 0x0020 },
{ 0, 0x0000 }
};
#ifdef PCIINTR_DEBUG
void pcibios_print_pir_table __P((void));
#endif
@ -301,6 +314,9 @@ pcibios_pir_init()
}
printf("\n");
pcibios_print_exclirq();
/* for Libretto L2/L3 hack */
pcibios_fixup_pir_table();
#ifdef PCIINTR_DEBUG
pcibios_print_pir_table();
#endif
@ -333,6 +349,9 @@ pcibios_pir_init()
printf("PCI BIOS has %d Interrupt Routing table entries\n",
pcibios_pir_table_nentries);
pcibios_print_exclirq();
/* for Libretto L2/L3 hack */
pcibios_fixup_pir_table();
#ifdef PCIINTR_DEBUG
pcibios_print_pir_table();
#endif
@ -478,6 +497,32 @@ pcibios_print_exclirq()
}
}
/* for Libretto L2/L3 hack */
void
pcibios_fixup_pir_table()
{
struct pcibios_linkmap *m;
for (m = pir_mask; m->link != 0; m++)
pcibios_fixup_pir_table_mask(m);
}
void
pcibios_fixup_pir_table_mask(mask)
struct pcibios_linkmap *mask;
{
int i, j;
for (i = 0; i < pcibios_pir_table_nentries; i++) {
for (j = 0; j < 4; j++) {
if (pcibios_pir_table[i].linkmap[j].link == mask->link) {
pcibios_pir_table[i].linkmap[j].bitmap
&= mask->bitmap;
}
}
}
}
#ifdef PCIINTR_DEBUG
void
pcibios_print_pir_table()