From owner-svn-src-head@freebsd.org Tue Apr 19 23:41:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E7B7B15E96; Tue, 19 Apr 2016 23:41:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E5E411BE; Tue, 19 Apr 2016 23:41:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNflZX096197; Tue, 19 Apr 2016 23:41:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNfkmK096186; Tue, 19 Apr 2016 23:41:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192341.u3JNfkmK096186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 23:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298308 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 i386/i386 i386/ibcs2 i386/linux x86/isa x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:41:48 -0000 Author: pfg Date: Tue Apr 19 23:41:46 2016 New Revision: 298308 URL: https://svnweb.freebsd.org/changeset/base/298308 Log: X86: use our nitems() macro when it is avaliable through param.h. No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Modified: head/sys/amd64/amd64/amd64_mem.c head/sys/amd64/amd64/machdep.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/i386/i686_mem.c head/sys/i386/i386/machdep.c head/sys/i386/ibcs2/ibcs2_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/x86/isa/atpic.c head/sys/x86/x86/identcpu.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Tue Apr 19 23:37:24 2016 (r298307) +++ head/sys/amd64/amd64/amd64_mem.c Tue Apr 19 23:41:46 2016 (r298308) @@ -117,7 +117,7 @@ static int amd64_mtrrtomrt[] = { MDF_WRITEBACK }; -#define MTRRTOMRTLEN (sizeof(amd64_mtrrtomrt) / sizeof(amd64_mtrrtomrt[0])) +#define MTRRTOMRTLEN nitems(amd64_mtrrtomrt) static int amd64_mtrr2mrt(int val) Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Apr 19 23:37:24 2016 (r298307) +++ head/sys/amd64/amd64/machdep.c Tue Apr 19 23:41:46 2016 (r298308) @@ -217,8 +217,8 @@ vm_paddr_t phys_avail[PHYSMAP_SIZE + 2]; vm_paddr_t dump_avail[PHYSMAP_SIZE + 2]; /* must be 2 less so 0 0 can signal end of chunks */ -#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(phys_avail[0])) - 2) -#define DUMP_AVAIL_ARRAY_END ((sizeof(dump_avail) / sizeof(dump_avail[0])) - 2) +#define PHYS_AVAIL_ARRAY_END (nitems(phys_avail) - 2) +#define DUMP_AVAIL_ARRAY_END (nitems(dump_avail) - 2) struct kva_md_info kmi; Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Tue Apr 19 23:37:24 2016 (r298307) +++ head/sys/amd64/linux/linux_sysvec.c Tue Apr 19 23:41:46 2016 (r298308) @@ -186,7 +186,7 @@ static int _bsd_to_linux_trapcode[] = { 15 /* 30 T_RESERVED */ }; #define bsd_to_linux_trapcode(code) \ - ((code)