Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 use __arraycount, and fix comparison



details:   https://anonhg.NetBSD.org/src/rev/ced953c27e09
branches:  trunk
changeset: 1009004:ced953c27e09
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 09 01:55:58 2020 +0000

description:
use __arraycount, and fix comparison

diffstat:

 sys/arch/x86/x86/identcpu.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 173bcdf566ea -r ced953c27e09 sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c       Thu Apr 09 01:49:26 2020 +0000
+++ b/sys/arch/x86/x86/identcpu.c       Thu Apr 09 01:55:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: identcpu.c,v 1.103 2020/04/09 01:49:26 christos Exp $  */
+/*     $NetBSD: identcpu.c,v 1.104 2020/04/09 01:55:58 christos Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.103 2020/04/09 01:49:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.104 2020/04/09 01:55:58 christos Exp $");
 
 #include "opt_xen.h"
 
@@ -750,7 +750,7 @@
        static const char *cpu_vortex86_flavor[] = {
            "??", "SX", "DX", "MX", "DX2", "MX+", "DX3", "EX", "EX2",
        };
-       idx = sizeof(cpu_vortex86_flavor) > idx ? idx : 0;
+       idx = __arraycount(cpu_vortex86_flavor) < idx ? idx : 0;
        snprintf(cpu_brand_string, sizeof(cpu_brand_string), "Vortex86%s",
            cpu_vortex86_flavor[idx]);
 



Home | Main Index | Thread Index | Old Index