Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/oea Fix shadowing and cast qualification wa...
details: https://anonhg.NetBSD.org/src/rev/0568045386a5
branches: trunk
changeset: 581513:0568045386a5
user: he <he%NetBSD.org@localhost>
date: Thu Jun 02 09:19:20 2005 +0000
description:
Fix shadowing and cast qualification warnings.
diffstat:
sys/arch/powerpc/oea/cpu_subr.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diffs (63 lines):
diff -r a4751fbd6673 -r 0568045386a5 sys/arch/powerpc/oea/cpu_subr.c
--- a/sys/arch/powerpc/oea/cpu_subr.c Thu Jun 02 09:18:14 2005 +0000
+++ b/sys/arch/powerpc/oea/cpu_subr.c Thu Jun 02 09:19:20 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_subr.c,v 1.23 2005/02/03 14:47:09 briggs Exp $ */
+/* $NetBSD: cpu_subr.c,v 1.24 2005/06/02 09:19:20 he Exp $ */
/*-
* Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.23 2005/02/03 14:47:09 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.24 2005/06/02 09:19:20 he Exp $");
#include "opt_ppcparam.h"
#include "opt_multiprocessor.h"
@@ -370,7 +370,8 @@
struct cpu_info *ci;
{
u_int hid0, pvr, vers;
- char *bitmask, hidbuf[128];
+ const char *bitmask;
+ char hidbuf[128];
char model[80];
pvr = mfpvr();
@@ -574,7 +575,7 @@
void
cpu_identify(char *str, size_t len)
{
- u_int pvr, maj, min;
+ u_int pvr, major, minor;
uint16_t vers, rev, revfmt;
const struct cputab *cp;
const char *name;
@@ -585,12 +586,12 @@
rev = pvr;
switch (vers) {
case MPC7410:
- min = (pvr >> 0) & 0xff;
- maj = min <= 4 ? 1 : 2;
+ minor = (pvr >> 0) & 0xff;
+ major = minor <= 4 ? 1 : 2;
break;
default:
- maj = (pvr >> 8) & 0xf;
- min = (pvr >> 0) & 0xf;
+ major = (pvr >> 8) & 0xf;
+ minor = (pvr >> 0) & 0xf;
}
for (cp = models; cp->name[0] != '\0'; cp++) {
@@ -619,7 +620,7 @@
if (len > n) {
switch (revfmt) {
case REVFMT_MAJMIN:
- snprintf(str + n, len - n, "%u.%u)", maj, min);
+ snprintf(str + n, len - n, "%u.%u)", major, minor);
break;
case REVFMT_HEX:
snprintf(str + n, len - n, "0x%04x)", rev);
Home |
Main Index |
Thread Index |
Old Index