From: Andrew Morton <akpm@linux-foundation.org>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PTR_ALIGN
Date: Mon, 10 Sep 2007 01:03:18 -0700 [thread overview]
Message-ID: <20070910010318.971bcfff.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070823114703.GQ9163@parisc-linux.org>
On Thu, 23 Aug 2007 05:47:03 -0600 Matthew Wilcox <matthew@wil.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@wil.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.
prev parent reply other threads:[~2007-09-10 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-23 11:47 [PATCH] PTR_ALIGN Matthew Wilcox
2007-09-10 8:03 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070910010318.971bcfff.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox