Date: Tue, 26 Apr 2016 12:59:22 -0700 From: Maxim Sobolev <sobomax@FreeBSD.org> To: Pedro Giffuni <pfg@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn: stable/10/sys: amd64/amd64 amd64/linux amd64/linux32 compat/linux dev/cxgbe/tom i386/linux vm Message-ID: <CAH7qZfv4jYGqnAhO5vKYE6QFtcSVUNMUH8uGdshOk-B2f9M5og@mail.gmail.com> In-Reply-To: <64931143-1496-56b9-8dc7-f11cbb0c06ed@FreeBSD.org> References: <201604261739.u3QHdtSd082499@repo.freebsd.org> <CAH7qZfuK1_ZOovgfrZ2fnMhyUEO92rKbwLOD4vZGPbwDdxVf=A@mail.gmail.com> <64931143-1496-56b9-8dc7-f11cbb0c06ed@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <pfg@freebsd.org> 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 <pfg@freebsd.org >> <mailto:pfg@freebsd.org>> 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) >> >> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAH7qZfv4jYGqnAhO5vKYE6QFtcSVUNMUH8uGdshOk-B2f9M5og>