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 instead of locally defined...



details:   https://anonhg.NetBSD.org/src/rev/6480c42d0958
branches:  trunk
changeset: 750769:6480c42d0958
user:      njoly <njoly%NetBSD.org@localhost>
date:      Wed Jan 13 15:31:47 2010 +0000

description:
Use __arraycount instead of locally defined macro.

diffstat:

 sys/arch/x86/x86/linux_trap.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 96c60aa265e0 -r 6480c42d0958 sys/arch/x86/x86/linux_trap.c
--- a/sys/arch/x86/x86/linux_trap.c     Wed Jan 13 15:21:16 2010 +0000
+++ b/sys/arch/x86/x86/linux_trap.c     Wed Jan 13 15:31:47 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_trap.c,v 1.8 2009/11/21 03:11:01 rmind Exp $     */
+/*     $NetBSD: linux_trap.c,v 1.9 2010/01/13 15:31:47 njoly Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.8 2009/11/21 03:11:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.9 2010/01/13 15:31:47 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -125,8 +125,6 @@
        SIGSEGV                         /* 18 LINUX_T_MACHINE_CHECK */
 };
 
-#define ASIZE(a) (sizeof(a) / sizeof(a[0]))
-
 void
 linux_trapsignal(struct lwp *l, ksiginfo_t *ksi)
 {
@@ -139,10 +137,10 @@
        case SIGFPE:
        case SIGSEGV:
                KASSERT(KSI_TRAP_P(ksi));
-               if (ksi->ksi_trap < ASIZE(trapno_to_x86_vec)) {
+               if (ksi->ksi_trap < __arraycount(trapno_to_x86_vec)) {
                        ksiginfo_t nksi = *ksi;
                        nksi.ksi_trap = trapno_to_x86_vec[ksi->ksi_trap];
-                       if (nksi.ksi_trap < ASIZE(linux_x86_vec_to_sig)) {
+                       if (nksi.ksi_trap < __arraycount(linux_x86_vec_to_sig)) {
                                nksi.ksi_signo 
                                    = linux_x86_vec_to_sig[nksi.ksi_trap];
                        } else {



Home | Main Index | Thread Index | Old Index