Date: Sat, 30 Apr 2016 14:39:36 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: Justin Hibbits <chmeeedalf@gmail.com> Cc: src-committers <src-committers@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r298856 - head/sys/powerpc/powerpc Message-ID: <127f3109-39f9-c65f-2c16-140c6a878de9@FreeBSD.org> In-Reply-To: <CAHSQbTARk443qKkW7-Ge_n4bzV-ghg7OpqUrVJ_%2B1f0QNXRWpQ@mail.gmail.com> References: <201604301856.u3UIuZpi026290@repo.freebsd.org> <CAHSQbTARk443qKkW7-Ge_n4bzV-ghg7OpqUrVJ_%2B1f0QNXRWpQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 04/30/16 14:24, Justin Hibbits wrote: > > On Apr 30, 2016 13:56, "Pedro F. Giffuni" <pfg@freebsd.org > <mailto:pfg@freebsd.org>> wrote: >> >> Author: pfg >> Date: Sat Apr 30 18:56:35 2016 >> New Revision: 298856 >> URL: https://svnweb.freebsd.org/changeset/base/298856 >> >> Log: >> powerpc: Make use of our rounddown() macro when sys/param.h is > available. >> >> No functional change. >> >> Modified: >> head/sys/powerpc/powerpc/exec_machdep.c >> >> Modified: head/sys/powerpc/powerpc/exec_machdep.c >> > ============================================================================== >> --- head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:07:13 > 2016 (r298855) >> +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:56:35 > 2016 (r298856) >> @@ -162,7 +162,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, >> code = siginfo32.si_code; >> sfp = (caddr_t)&sf32; >> sfpsize = sizeof(sf32); >> - rndfsize = ((sizeof(sf32) + 15) / 16) * 16; >> + rndfsize = rounddown(sizeof(sf32) + 15, 16); >> >> /* >> * Save user context >> @@ -189,9 +189,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, >> * 64-bit PPC defines a 288 byte scratch region >> * below the stack. >> */ >> - rndfsize = 288 + ((sizeof(sf) + 47) / 48) * 48; >> + rndfsize = 288 + rounddown(sizeof(sf) + 47, 48); >> #else >> - rndfsize = ((sizeof(sf) + 15) / 16) * 16; >> + rndfsize = rounddown(sizeof(sf) + 15, 16); >> #endif >> >> /* >> > > I think these should all be roundup(sizeof(sf), (16 or 48)). > Yes, makes sense. roundup() is a special case of rounddown() but coccinelle doesn't do math ;). Thanks, Pedro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?127f3109-39f9-c65f-2c16-140c6a878de9>