From owner-svn-src-all@freebsd.org Tue Apr 26 19:59:23 2016 Return-Path: Delivered-To: svn-src-all@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 40235B19E4B for ; Tue, 26 Apr 2016 19:59:23 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) (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 17159181A for ; Tue, 26 Apr 2016 19:59:23 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ob0-x236.google.com with SMTP id j9so12392485obd.3 for ; Tue, 26 Apr 2016 12:59:22 -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=bL2UAzTyeyvuZ2bDK7VqBL7gb2fOH5KlSay31nsa62I=; b=fIDrDP8wSjHP9vaJubk7weP1l4r38R33KXa3IvjwlQJETAREZMPB2JpBWFqDBVG7PH 16mfK4l4jiLn5aQt2q5XNTXXNd70Hc0hq53Aq1Aol6iKOIPo2tXSKA7nvr8d1q6zpFMO REe468B6Fza87BjTQhW5+B+2e7cR4q4/Wu+Eoum5cr4sMgvew0U/eyv4nFVpWqHwXozG VeM0rM/D+NXS1Gjd6Ux9MVn3w/qFBzspAImYstPWDJtkXtV3rxhbMyxm8w5cjBON52rR d3ytagytQVbXDm/Yz6LcBqZlakk/jSAygRwT1yeyUZ7/xZ9+VqTAH/2b4rPEDACu5TEZ C1ig== 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=bL2UAzTyeyvuZ2bDK7VqBL7gb2fOH5KlSay31nsa62I=; b=CSWPmijL/mRjHxPyX69AzhBqWvEdVMclPimX1vHccYS6fNUwb1NSj9BWcM2KBobZKc vmhiLicNHM6F+w0ksgU88mY24YUiyI5V+mat+5rSVWpd8FFtaqt2qcCYbmOUew4fBj4w DJxxbeCLWzwW4ksRTTLqeE6OhgfEPr9seOLpxv89CRfv5QHZtRFMVzAX9TDQDMt3re4b 1Bq4/WB5pCe9oxHcMx+6G5mniV9z5uOm/y+0ND25BHZDOzZxwO7dDASkgHUL0fPitI5M 7ySwYWX6TOoGNriJ5gSVRrJrkNp/2ul6OQmeF26+n+4DChH/qCSSjhIgcvmSTqvZIjD7 rFEw== X-Gm-Message-State: AOPr4FWesk1ZnBf4kelzSg8a3xCYSOmA8GZL0Kt4H3RdoPvZfXv9aE8IvaIDA2pfiDO1EWrHqXAm9OuQwhK0NHSg MIME-Version: 1.0 X-Received: by 10.60.173.210 with SMTP id bm18mr1815903oec.30.1461700762355; Tue, 26 Apr 2016 12:59:22 -0700 (PDT) Sender: sobomax@sippysoft.com Received: by 10.157.45.21 with HTTP; Tue, 26 Apr 2016 12:59:22 -0700 (PDT) In-Reply-To: <64931143-1496-56b9-8dc7-f11cbb0c06ed@FreeBSD.org> References: <201604261739.u3QHdtSd082499@repo.freebsd.org> <64931143-1496-56b9-8dc7-f11cbb0c06ed@FreeBSD.org> Date: Tue, 26 Apr 2016 12:59:22 -0700 X-Google-Sender-Auth: NQJkVt180OnsYxoZGdQtV4jkaWg 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 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-all@freebsd.org X-Mailman-Version: 2.1.21 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, 26 Apr 2016 19:59:23 -0000 Yeah, sure no rush. Another interesting mode of failure to check in howmany(X, S) is KASSERT((X % S) == 0). There might be few cases when it's intended behaviour, but for majority of them it should be indication of some kind of programmatic error (i.e. missing a cast in sizeof and getting void * size instead of the structure size). Those which rely on rounding could then be separated into howmany_rup() and howmany_rdown() or something. On Tue, Apr 26, 2016 at 12:04 PM, Pedro Giffuni wrote: > Hello > > On 04/26/16 13:42, Maxim Sobolev wrote: > >> 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 >> >> > I agree, we need those documented. There's also rounddown, roundup2 and > rounddown2. > > FWIW, I am tired of these massive replacements, and will likely take > a break before trying rounddown. > > Pedro. > > 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) >> >> >