All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: kernel-janitors@vger.kernel.org
Subject: more cleanup -- using FIELD_SIZEOF() macro
Date: Sun, 10 Feb 2008 11:39:58 +0000	[thread overview]
Message-ID: <alpine.LFD.1.00.0802100637001.9465@localhost.localdomain> (raw)


  the header file include/linux/kernel.h defines:

  #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))

which is a much more pleasant way of calculating the size of a
structure member.  and there's plenty of places in the tree where that
change can be made, which you can see if you search for the
appropriate pattern:

$ grep -Er "sizeof ?\( ?\( ?\([^\*]*[^ ] ?\*\) ?0 ?\)->[^\)]+\)" *

rday
--


====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

Home page:                                         http://crashcourse.ca
Fedora Cookbook:    http://crashcourse.ca/wiki/index.php/Fedora_Cookbook
====================================

             reply	other threads:[~2008-02-10 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 11:39 Robert P. J. Day [this message]
2008-02-10 20:56 ` more cleanup -- using FIELD_SIZEOF() macro Julia Lawall
2008-02-10 22:14 ` Randy Dunlap
2008-02-10 22:22 ` Julia Lawall
2008-02-10 23:54 ` Robert P. J. Day

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=alpine.LFD.1.00.0802100637001.9465@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.