[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130529194438.GY3333@ritirata.org>
Date: Wed, 29 May 2013 21:44:38 +0200
From: Antonio Quartulli <ordex@...istici.org>
To: Ben Hutchings <bhutchings@...arflare.com>
Cc: David Miller <davem@...emloft.net>, amwang@...hat.com,
netdev@...r.kernel.org, horms@...ge.net.au
Subject: Re: [Patch net-next] net: clean up skb headers code
On Wed, May 29, 2013 at 08:34:33PM +0100, Ben Hutchings wrote:
> On Tue, 2013-05-28 at 23:36 -0700, David Miller wrote:
> > From: Cong Wang <amwang@...hat.com>
> > Date: Wed, 29 May 2013 14:09:00 +0800
> >
> > > commit 1a37e412a0225fcba5587 (net: Use 16bits for *_headers
> > > fields of struct skbuff) converts skb->*_header to u16,
> > > therefore 1) we could just use 0xFFFFF instead of (__u16) ~0U
> > > 2) some #if NET_SKBUFF_DATA_USES_OFFSET is useless now.
> > >
> > >
> > > Cc: David S. Miller <davem@...emloft.net>
> > > Cc: Simon Horman <horms@...ge.net.au>
> > > Signed-off-by: Cong Wang <amwang@...hat.com>
> >
> > I want to use something that will either break the build or
> > automatically work if the type changes again.
> >
> > So something like "X = (typeof(X)) ~0U;".
>
> I think you mean ~(typeof(X))0.
Am I wrong or you should cast the value once again, like this:
((typeof(X))~(typeof(X))0)
because the ~ operator will implicitly cast the argument to int (if I remember
correctly).
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists