Author: pfg
Date: Tue Jun 16 20:19:00 2015
New Revision: 284462
URL: https://svnweb.freebsd.org/changeset/base/284462

Log:
  Use nitems() macro instead of __arraycount()

Modified:
  head/sys/kern/stack_protector.c

Modified: head/sys/kern/stack_protector.c
==============================================================================
--- head/sys/kern/stack_protector.c     Tue Jun 16 20:01:01 2015        
(r284461)
+++ head/sys/kern/stack_protector.c     Tue Jun 16 20:19:00 2015        
(r284462)
@@ -17,15 +17,14 @@ __stack_chk_fail(void)
        panic("stack overflow detected; backtrace may be corrupted");
 }
 
-#define __arraycount(__x)      (sizeof(__x) / sizeof(__x[0]))
 static void
 __stack_chk_init(void *dummy __unused)
 {
        size_t i;
-       long guard[__arraycount(__stack_chk_guard)];
+       long guard[nitems(__stack_chk_guard)];
 
        arc4rand(guard, sizeof(guard), 0);
-       for (i = 0; i < __arraycount(guard); i++)
+       for (i = 0; i < nitems(guard); i++)
                __stack_chk_guard[i] = guard[i];
 }
 SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to