All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: davem@redhat.com, netdev@vger.kernel.org,
	Christine Caulfield <ccaulfie@redhat.com>
Subject: Re: decnet: Fix complier warning
Date: Wed, 15 Oct 2008 13:40:35 +0100	[thread overview]
Message-ID: <1224074435.25004.87.camel@quoit> (raw)
In-Reply-To: <1224074238.3984.169.camel@achroite>

Hi,

On Wed, 2008-10-15 at 13:37 +0100, Ben Hutchings wrote:
> On Wed, 2008-10-15 at 13:19 +0100, Steven Whitehouse wrote:
> > This patch fixes a warning seen during compiling dn_dev.c. The warning is harmless
> > since we know that the structure length in question is less than 2^32 bytes, but
> > this fixes it anyway.
> > 
> > Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> > Cc: Christine Caulfield <ccaulfie@redhat.com>
> > 
> > diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
> > index 2f0ac3c..d9bc69c 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) ((long) ((char *) &((struct dn_dev_parms *)0)->x))
> >  
> >  #ifdef CONFIG_SYSCTL
> >  
> 
> Or you could make this use offsetof().  Daring, I know, it's only been a
> standard macro for nearly 20 years.
> 
> Ben.
> 
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,

Steve.



  reply	other threads:[~2008-10-15 12:42 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 [this message]
2008-10-15 22:57     ` David Miller

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=1224074435.25004.87.camel@quoit \
    --to=swhiteho@redhat.com \
    --cc=bhutchings@solarflare.com \
    --cc=ccaulfie@redhat.com \
    --cc=davem@redhat.com \
    --cc=netdev@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.