Re: [RFC 12/12] asm-generic: simplify asm/unaligned.h
From: Linus Torvalds
Date: Sat May 08 2021 - 11:23:50 EST
On Sat, May 8, 2021 at 2:29 AM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
> On Sat, May 8, 2021 at 1:54 AM Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > #define get_unaligned(ptr) \
> > __get_unaligned_t(typeof(*__ptr), __ptr)
That's missing a set of parentheses around that __ptr thing ('*__ptr'
should be '*(__ptr)'), btw, so don't use that as-is.
> Both versions are equally correct, I picked the __auto_type version
> because this tends to produce smaller preprocessor output when you have
> multiple layers of nested macros with 'ptr' expanding to something
> complicated,
Ahh.
Yeah, that's probably not a problem for get_unaligned(), but it might
happen in other situations.
Linus