From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 19:58:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E76EB1065672; Tue, 5 Jun 2012 19:58:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D97C8FC08; Tue, 5 Jun 2012 19:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55JwxTO040698; Tue, 5 Jun 2012 19:58:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55JwxTN040695; Tue, 5 Jun 2012 19:58:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206051958.q55JwxTN040695@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 19:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236631 - in stable/9/sys: dev/iwn sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 19:59:00 -0000 Author: marius Date: Tue Jun 5 19:58:58 2012 New Revision: 236631 URL: http://svn.freebsd.org/changeset/base/236631 Log: MFC: r236486 Add nitems(), a macro for determining the number of elements in a statically-allocated array. Obtained from: OpenBSD (in principle) MFC: r236489 Modified: stable/9/sys/dev/iwn/if_iwn.c stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Tue Jun 5 19:51:37 2012 (r236630) +++ stable/9/sys/dev/iwn/if_iwn.c Tue Jun 5 19:58:58 2012 (r236631) @@ -2005,8 +2005,6 @@ iwn_setregdomain(struct ieee80211com *ic return 0; } -#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) - static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue Jun 5 19:51:37 2012 (r236630) +++ stable/9/sys/sys/param.h Tue Jun 5 19:58:58 2012 (r236631) @@ -273,6 +273,7 @@ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */