From owner-svn-src-stable-10@freebsd.org Tue Apr 26 18:42:06 2016 Return-Path: Delivered-To: svn-src-stable-10@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 2B632B1C77C for ; Tue, 26 Apr 2016 18:42:06 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ob0-x231.google.com (mail-ob0-x231.google.com [IPv6:2607:f8b0:4003:c01::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED90B1796 for ; Tue, 26 Apr 2016 18:42:05 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ob0-x231.google.com with SMTP id bg3so11410654obb.1 for ; Tue, 26 Apr 2016 11:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=2J6EJNPqfoTzXyxg3rIXgRTMHEa9BccFBkbHYrgoEFY=; b=kgoOUe24nH2lOrj0YeLT22f71qi0wufbRwP7X/mChFaAyYb1x1VWkVMFI36PAuMvfT ksYc1dsBu2n4c0xc78nSJBD5LMVCIe8DyOhLjnN5jslly6QXx+zP/5gvmyFwRzebIhR7 DIffwhclo8ZGPmWtw6X0XfOEjk3Zo0jvEdMxMMZ0lJhnd7hyFFWRYXTA+Q7DZtI1eglb C32QGfXBWpXenfb6WwmG+6KzJPZkVVfysUNr4CulCk9/5HOq/K72PFetgoDMJ8eRNEQ0 apuBOk1mXinbqm5eDaDZELy7t8ID3wF2bqMcWSqq8SqzUAabenM/JUHEXO3KR92u6A62 jEtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=2J6EJNPqfoTzXyxg3rIXgRTMHEa9BccFBkbHYrgoEFY=; b=bcxDE2hvBv01cg/adxmtbJNGXl6MbhPu5ul09GzgMo8HDwF/lmLWzn6h2ggPo/7mYo DwxnInzJraTKoE3OqYONfNOUK5DBiKIIzLu1iY9Hg4JrYpN/mhxvjIYCXT8xPxcNYWER 0UdqaOoiRB/lABHnuzWJi5IIcCXZD1RAcTOwUjmbMzH7iqKV7WREG/yTaShgZ1otySJh oxSyV8Ocpb5fkvYWjhKfaCHXlbwx5XNSJ2hPKasRjh6dXl0hG6kEiJcr2yAStO/Ebi0y MMJtcZ9tRhrbMPO/WaLGKf5VWk0264a94c/KYt+ZZLicLDY4vZK7hFHjd84rwhLblUFq lqow== X-Gm-Message-State: AOPr4FX3FEjPUkywTmVZe+2X3f1yxgeqM/Ls4CmK8QbfGOx0TI+l+miO1tRXgPJwypqiGvRFeILVztbnxfxoqoZd MIME-Version: 1.0 X-Received: by 10.182.146.37 with SMTP id sz5mr1702972obb.24.1461696125077; Tue, 26 Apr 2016 11:42:05 -0700 (PDT) Sender: sobomax@sippysoft.com Received: by 10.157.45.21 with HTTP; Tue, 26 Apr 2016 11:42:05 -0700 (PDT) In-Reply-To: <201604261739.u3QHdtSd082499@repo.freebsd.org> References: <201604261739.u3QHdtSd082499@repo.freebsd.org> Date: Tue, 26 Apr 2016 11:42:05 -0700 X-Google-Sender-Auth: mwpPaZq7usOvGvx2G5KPEzuHp0I Message-ID: Subject: Re: svn: stable/10/sys: amd64/amd64 amd64/linux amd64/linux32 compat/linux dev/cxgbe/tom i386/linux vm From: Maxim Sobolev To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:42:06 -0000 Given the widespread use of those two macros, maybe we need howmany.9 and roundup.9 manual pages with detailed formal description? Particularly interested in how "return" supposed to be typed. Another thing is that would be nice is some kind of automatic #error/#warning/printf/KASSERT/panic when (X < Y || Y <= 0) & defined(INVARIANTS). -Max On Tue, Apr 26, 2016 at 10:39 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Apr 26 17:39:54 2016 > New Revision: 298653 > URL: https://svnweb.freebsd.org/changeset/base/298653 > > Log: > MFC r298482: > Cleanup redundant parenthesis from existing howmany()/roundup() macro > uses. > > Requested by: dchagin > > Modified: > stable/10/sys/amd64/amd64/pmap.c > stable/10/sys/amd64/linux/linux_sysvec.c > stable/10/sys/amd64/linux32/linux32_sysvec.c > stable/10/sys/compat/linux/linux_file.c > stable/10/sys/dev/cxgbe/tom/t4_tom.c > stable/10/sys/i386/linux/linux_sysvec.c > stable/10/sys/vm/vm_radix.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/amd64/amd64/pmap.c > > ============================================================================== > --- stable/10/sys/amd64/amd64/pmap.c Tue Apr 26 16:40:04 2016 > (r298652) > +++ stable/10/sys/amd64/amd64/pmap.c Tue Apr 26 17:39:54 2016 > (r298653) > @@ -678,7 +678,7 @@ allocpages(vm_paddr_t *firstaddr, int n) > CTASSERT(powerof2(NDMPML4E)); > > /* number of kernel PDP slots */ > -#define NKPDPE(ptpgs) howmany((ptpgs), NPDEPG) > +#define NKPDPE(ptpgs) howmany(ptpgs, NPDEPG) > > static void > nkpt_init(vm_paddr_t addr) > > Modified: stable/10/sys/amd64/linux/linux_sysvec.c > > ============================================================================== > --- stable/10/sys/amd64/linux/linux_sysvec.c Tue Apr 26 16:40:04 2016 > (r298652) > +++ stable/10/sys/amd64/linux/linux_sysvec.c Tue Apr 26 17:39:54 2016 > (r298653) > @@ -346,7 +346,7 @@ linux_copyout_strings(struct image_param > destp = (caddr_t)arginfo - SPARE_USRSPACE - > roundup(sizeof(canary), sizeof(char *)) - > roundup(execpath_len, sizeof(char *)) - > - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); > + roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); > > if (execpath_len != 0) { > imgp->execpathp = (uintptr_t)arginfo - execpath_len; > > Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c > > ============================================================================== > --- stable/10/sys/amd64/linux32/linux32_sysvec.c Tue Apr 26 > 16:40:04 2016 (r298652) > +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Tue Apr 26 > 17:39:54 2016 (r298653) > @@ -862,7 +862,7 @@ linux_copyout_strings(struct image_param > destp = (caddr_t)arginfo - SPARE_USRSPACE - > roundup(sizeof(canary), sizeof(char *)) - > roundup(execpath_len, sizeof(char *)) - > - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); > + roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); > > if (execpath_len != 0) { > imgp->execpathp = (uintptr_t)arginfo - execpath_len; > > Modified: stable/10/sys/compat/linux/linux_file.c > > ============================================================================== > --- stable/10/sys/compat/linux/linux_file.c Tue Apr 26 16:40:04 2016 > (r298652) > +++ stable/10/sys/compat/linux/linux_file.c Tue Apr 26 17:39:54 2016 > (r298653) > @@ -305,11 +305,10 @@ struct l_dirent64 { > * at least glibc-2.7 requires it. That is why l_dirent is padded with 2 > bytes. > */ > #define LINUX_RECLEN(namlen) \ > - roundup((offsetof(struct l_dirent, d_name) + (namlen) + 2), > \ > - sizeof(l_ulong)) > + roundup(offsetof(struct l_dirent, d_name) + (namlen) + 2, > sizeof(l_ulong)) > > #define LINUX_RECLEN64(namlen) \ > - roundup((offsetof(struct l_dirent64, d_name) + (namlen) + 1), \ > + roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, > \ > sizeof(uint64_t)) > > #define LINUX_MAXRECLEN max(LINUX_RECLEN(LINUX_NAME_MAX), > \ > > Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c > > ============================================================================== > --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 26 16:40:04 2016 > (r298652) > +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 26 17:39:54 2016 > (r298653) > @@ -124,7 +124,7 @@ alloc_toepcb(struct port_info *pi, int t > * units of 16 byte. Calculate the maximum work requests possible. > */ > txsd_total = tx_credits / > - howmany((sizeof(struct fw_ofld_tx_data_wr) + 1), 16); > + howmany(sizeof(struct fw_ofld_tx_data_wr) + 1, 16); > > if (txqid < 0) > txqid = (arc4random() % pi->nofldtxq) + pi->first_ofld_txq; > > Modified: stable/10/sys/i386/linux/linux_sysvec.c > > ============================================================================== > --- stable/10/sys/i386/linux/linux_sysvec.c Tue Apr 26 16:40:04 2016 > (r298652) > +++ stable/10/sys/i386/linux/linux_sysvec.c Tue Apr 26 17:39:54 2016 > (r298653) > @@ -320,7 +320,7 @@ linux_copyout_strings(struct image_param > destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - > roundup(sizeof(canary), sizeof(char *)) - > roundup(execpath_len, sizeof(char *)) - > - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); > + roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); > > /* > * install LINUX_PLATFORM > > Modified: stable/10/sys/vm/vm_radix.c > > ============================================================================== > --- stable/10/sys/vm/vm_radix.c Tue Apr 26 16:40:04 2016 (r298652) > +++ stable/10/sys/vm/vm_radix.c Tue Apr 26 17:39:54 2016 (r298653) > @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); > #define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH) > #define VM_RADIX_MASK (VM_RADIX_COUNT - 1) > #define VM_RADIX_LIMIT > \ > - (howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH) - 1) > + (howmany(sizeof(vm_pindex_t) * NBBY, VM_RADIX_WIDTH) - 1) > > /* Flag bits stored in node pointers. */ > #define VM_RADIX_ISLEAF 0x1 > >