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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 10 Sep 2007 01:03:18 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Matthew Wilcox <matthew@....cx>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PTR_ALIGN

On Thu, 23 Aug 2007 05:47:03 -0600 Matthew Wilcox <matthew@....cx> wrote:

> 
> The AdvanSys driver wants to align some pointers, and the ALIGN macro
> doesn't work for pointers.  Rather than try to make it work, add a new
> PTR_ALIGN macro which is typesafe.
> 
> Signed-off-by: Matthew Wilcox <matthew@....cx>
> 
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index f592df7..47160fe 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -34,6 +34,7 @@ extern const char linux_proc_banner[];
>  
>  #define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
>  #define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
> +#define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))
>  
>  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
>  

I'll plan on getting this thing of beauty into mainline in the next week or
so, so you can get those advansys changes into James's tree.

-
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