linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Laight <David.Laight@ACULAB.COM>,
	'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 04:53:24 -0700	[thread overview]
Message-ID: <7bd46e20c28f8f0a1b7b4ba49c151860bf6c58f1.camel@perches.com> (raw)
In-Reply-To: <a32bb1376821422fa3c647c01f3f1a95@AcuMS.aculab.com>

On Thu, 2019-05-30 at 11:37 +0000, David Laight wrote:
> 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 ...

While I did object to the avoidance in the obvious
misnaming of FIELD_SIZEOF, this could reasonably
be named FIELD_TYPEOF for symmetry.



  reply	other threads:[~2019-05-30 11:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 19:07 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 ` [PATCH 1/2] add " David Laight
2019-05-30 11:53   ` Joe Perches [this message]
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=7bd46e20c28f8f0a1b7b4ba49c151860bf6c58f1.camel@perches.com \
    --to=joe@perches.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/2] add typeof_member() macro' \
    /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

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).