[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130530122459.GE2475@ritirata.org>
Date: Thu, 30 May 2013 14:24:59 +0200
From: Antonio Quartulli <ordex@...istici.org>
To: David Laight <David.Laight@...LAB.COM>
Cc: Ben Hutchings <bhutchings@...arflare.com>,
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 Thu, May 30, 2013 at 01:22:14PM +0100, David Laight wrote:
> > Of course - we need to look at the value that ALL_ONES()
> > generates in an expression. So the test print needs to be:
> > printf("%hhx %hhx %hx %hx %x %x %lx %lx %llx %llx\n",
> > ALL_ONES(a), ALL_ONES(b), ALL_ONES(c), ALL_ONES(d),
> > ALL_ONES(e), ALL_ONES(f), ALL_ONES(g), ALL_ONES(h),
> > ALL_ONES(i), ALL_ONES(j));
> > which then gives 0xffffffff for the first 4 entries.
>
> Except I copied the wrong format line :-( It should be:
> printf("%x %x %x %x %x %x %lx %lx %llx %llx\n",
> ALL_ONES(a), ALL_ONES(b), ALL_ONES(c), ALL_ONES(d),
> ALL_ONES(e), ALL_ONES(f), ALL_ONES(g), ALL_ONES(h),
> ALL_ONES(i), ALL_ONES(j));
Oh ok, I see the issue now.
So the problem is that this value gets bigger than what the maximal
value for the type passed as argument is supposed to be.
I think the issue is clear now and why a double cast is good.
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