From: David Miller <davem@davemloft.net>
To: swhiteho@redhat.com
Cc: bhutchings@solarflare.com, netdev@vger.kernel.org, ccaulfie@redhat.com
Subject: Re: decnet: Fix complier warning
Date: Wed, 15 Oct 2008 15:57:46 -0700 (PDT) [thread overview]
Message-ID: <20081015.155746.76808335.davem@davemloft.net> (raw)
In-Reply-To: <1224074435.25004.87.camel@quoit>
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Wed, 15 Oct 2008 13:40:35 +0100
> On Wed, 2008-10-15 at 13:37 +0100, Ben Hutchings wrote:
> > Or you could make this use offsetof(). Daring, I know, it's only been a
> > standard macro for nearly 20 years.
>
> Yes, thats true. The whole set of code is rather suspect to say the
> least and I was going for the minimal fix. Its a long time since I last
> looked at this code so I don't remember exactly why it was done in that
> way,
I'm going to check in something like the following:
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 2f0ac3c..ba35258 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -152,7 +152,7 @@ static struct dn_dev_parms dn_dev_list[] = {
#define DN_DEV_LIST_SIZE ARRAY_SIZE(dn_dev_list)
-#define DN_DEV_PARMS_OFFSET(x) ((int) ((char *) &((struct dn_dev_parms *)0)->x))
+#define DN_DEV_PARMS_OFFSET(x) offsetof(struct dn_dev_parms, x)
#ifdef CONFIG_SYSCTL
prev parent reply other threads:[~2008-10-15 22:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 12:19 decnet: Fix complier warning Steven Whitehouse
2008-10-15 12:37 ` Ben Hutchings
2008-10-15 12:40 ` Steven Whitehouse
2008-10-15 22:57 ` David Miller [this message]
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=20081015.155746.76808335.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bhutchings@solarflare.com \
--cc=ccaulfie@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=swhiteho@redhat.com \
/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).