Subject: kern/11098: ROUNDUP is inconsistently used when ALIGN would be better.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <erh@netbsd.org>
List: netbsd-bugs
Date: 09/28/2000 20:13:33
>Number: 11098
>Category: kern
>Synopsis: ROUNDUP is inconsistently used when ALIGN would be better.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 28 20:19:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Eric Haszlakiewicz
>Release: Current as of Sep 28, 2000.
>Organization:
>Environment:
>Description:
There are several places in the kernel and in userland code
that use the ROUNDUP macro when passing addresses into and out of the
kernel. The apparant reason for this in most cases is to make sure
that each address is aligned correctly.
The problem is that the ROUNDUP macro is defined differently
in several different places. With the slight (and unused) feature
that at least one definition has where a length of 0 gets rounded up,
these all act in a similar fashion as the ALIGN macro. Furthermore,
there exists what might be considered a general ROUNDUP macro in
the sys/gmon.h header file with 2 arguments instead of 1.
>How-To-Repeat:
>Fix:
Proposed fix is to replace all custom occurances of ROUNDUP
with ALIGN after verifying the correctness of each change.
>Release-Note:
>Audit-Trail:
>Unformatted: