Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-30 Thread Masahiro Yamada
Hi. 2017-03-30 12:29 GMT+09:00 H. Peter Anvin : > On 03/29/17 18:57, Masahiro Yamada wrote: >> >> Could you care to send a patch? >> >> Perhaps, ALIGN and PTR_ALIGN can be merged as well? >> > > Can't promise when I'd get around to it... > > -hpa OK. No need to rush now.

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-30 Thread Masahiro Yamada
Hi. 2017-03-30 12:29 GMT+09:00 H. Peter Anvin : > On 03/29/17 18:57, Masahiro Yamada wrote: >> >> Could you care to send a patch? >> >> Perhaps, ALIGN and PTR_ALIGN can be merged as well? >> > > Can't promise when I'd get around to it... > > -hpa OK. No need to rush now. Please take a

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread H. Peter Anvin
On 03/29/17 18:57, Masahiro Yamada wrote: > > Could you care to send a patch? > > Perhaps, ALIGN and PTR_ALIGN can be merged as well? > Can't promise when I'd get around to it... -hpa

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread H. Peter Anvin
On 03/29/17 18:57, Masahiro Yamada wrote: > > Could you care to send a patch? > > Perhaps, ALIGN and PTR_ALIGN can be merged as well? > Can't promise when I'd get around to it... -hpa

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread Masahiro Yamada
Hi. 2017-03-30 6:24 GMT+09:00 H. Peter Anvin : > On 03/29/17 03:22, Masahiro Yamada wrote: >> We often check if a pointer has a specific alignment. Because the >> '&' (bitwise AND) operator cannot take a pointer for the operand, >> so we need a cast like, IS_ALIGNED((unsigned

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread Masahiro Yamada
Hi. 2017-03-30 6:24 GMT+09:00 H. Peter Anvin : > On 03/29/17 03:22, Masahiro Yamada wrote: >> We often check if a pointer has a specific alignment. Because the >> '&' (bitwise AND) operator cannot take a pointer for the operand, >> so we need a cast like, IS_ALIGNED((unsigned long)p, a). >> >>

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread H. Peter Anvin
On 03/29/17 03:22, Masahiro Yamada wrote: > We often check if a pointer has a specific alignment. Because the > '&' (bitwise AND) operator cannot take a pointer for the operand, > so we need a cast like, IS_ALIGNED((unsigned long)p, a). > > IS_PTR_ALIGNED will be useful as a shorthand. > >

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread H. Peter Anvin
On 03/29/17 03:22, Masahiro Yamada wrote: > We often check if a pointer has a specific alignment. Because the > '&' (bitwise AND) operator cannot take a pointer for the operand, > so we need a cast like, IS_ALIGNED((unsigned long)p, a). > > IS_PTR_ALIGNED will be useful as a shorthand. > >

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread Andrew Morton
On Wed, 29 Mar 2017 19:22:10 +0900 Masahiro Yamada wrote: > We often check if a pointer has a specific alignment. Because the > '&' (bitwise AND) operator cannot take a pointer for the operand, > so we need a cast like, IS_ALIGNED((unsigned long)p, a). > >

Re: [PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread Andrew Morton
On Wed, 29 Mar 2017 19:22:10 +0900 Masahiro Yamada wrote: > We often check if a pointer has a specific alignment. Because the > '&' (bitwise AND) operator cannot take a pointer for the operand, > so we need a cast like, IS_ALIGNED((unsigned long)p, a). > > IS_PTR_ALIGNED will be useful as a

[PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread Masahiro Yamada
We often check if a pointer has a specific alignment. Because the '&' (bitwise AND) operator cannot take a pointer for the operand, so we need a cast like, IS_ALIGNED((unsigned long)p, a). IS_PTR_ALIGNED will be useful as a shorthand. Signed-off-by: Masahiro Yamada

[PATCH] kernel.h: add IS_PTR_ALIGNED() macro

2017-03-29 Thread Masahiro Yamada
We often check if a pointer has a specific alignment. Because the '&' (bitwise AND) operator cannot take a pointer for the operand, so we need a cast like, IS_ALIGNED((unsigned long)p, a). IS_PTR_ALIGNED will be useful as a shorthand. Signed-off-by: Masahiro Yamada --- include/linux/kernel.h