lkml.org 
[lkml]   [2012]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] x86, UV: integer wrap bug in uv_hub_ipi_value()
On Tue, 20 Nov 2012 07:28:56 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> On Mon, Nov 19, 2012 at 06:48:34PM -0600, Russ Anderson wrote:
> > On Sat, Nov 17, 2012 at 06:16:11PM +0300, Dan Carpenter wrote:
> > > This is a static checker fix. The problem is that we store the bits
> > > from "uv_apicid_hibits" into "apicid" (the high 16 bits) but then we
> > > shift it 16 bit to the left. "apicid" is an int so it wraps and we lose
> > > them.
> >
> > Is this the complete patch? phys_apicid is an int, but gets
> > cast as unsigned long. Doesn't phys_apicid also have to be
> > changed to unsigned long? And why ulong instead of uint (on x86_64)?
>
> Uint is 32bit across all arches in linux and unix, according to
> wikipedia.

For Linux yes, if Wackypedia claims it for "unix" it's wrong 8) and varies
between 16 and 36bits that I can think of.

If you specifically want 32bits use "u32", it's not going to make any
actual difference to unsigned int but it makes the requirement explicit.

Alan


\
 
 \ /
  Last update: 2012-11-20 12:41    [W:0.710 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site