From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexey Dobriyan' <adobriyan@gmail.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/2] add typeof_member() macro
Date: Thu, 30 May 2019 11:37:42 +0000 [thread overview]
Message-ID: <a32bb1376821422fa3c647c01f3f1a95@AcuMS.aculab.com> (raw)
In-Reply-To: <20190529190720.GA5703@avx2>
From: Alexey Dobriyan
> Sent: 29 May 2019 20:07
>
> Add typeof_member() macro so that types can be exctracted without
> introducing dummy variables.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> include/linux/kernel.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -88,6 +88,8 @@
> */
> #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
>
> +#define typeof_member(T, m) typeof(((T*)0)->m)
Should probably be 't' (not 'T') and upper case ?
Hmmm.... the #define is longer that what it expands to ...
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2019-05-30 11:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 19:07 [PATCH 1/2] add typeof_member() macro Alexey Dobriyan
2019-05-29 19:11 ` [PATCH 2/2] proc: use " Alexey Dobriyan
2019-05-29 22:33 ` Andrew Morton
2019-05-30 11:37 ` David Laight [this message]
2019-05-30 11:53 ` [PATCH 1/2] add " Joe Perches
2019-05-30 19:57 ` Alexey Dobriyan
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=a32bb1376821422fa3c647c01f3f1a95@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).