lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0708261143470.4267@localhost.localdomain>
Date:	Sun, 26 Aug 2007 11:54:58 -0400 (EDT)
From:	"Robert P. J. Day" <rpjday@...dspring.com>
To:	Jiri Slaby <jirislaby@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] remove BITS_TO_TYPE macro

On Sun, 26 Aug 2007, Jiri Slaby wrote:

> remove BITS_TO_TYPE macro
>
> I realized, that it is actually the same as DIV_ROUND_UP, use it instead.

unless there are some patches in the queue, the whole area of rounding
up and aligning is still sort of messy.

kernel.h defines the following:

...
#define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask)    (((x)+(mask))&~(mask))
...
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
...

yet there is no corresponding DIV_ROUND_DOWN() or rounddown(), just
for the sake of consistency. (maybe there's simply no need?)

would someone like to propose a single, consistent standard for those
things?  or is it not worth it?

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ