[PATCH] Make sure get_user_desc() doesn't sign extend.

2009-10-23 Thread Chris Lalancette
The current implementation of get_user_desc() sign extends the return value because of integer promotion rules. For the most part, this doesn't matter, because the top bit of base2 is usually 0. If, however, that bit is 1, then the entire value will be 0x... which is probably not what the

[PATCH] Make sure get_user_desc() doesn't sign extend.

2009-10-21 Thread Chris Lalancette
The current implementation of get_user_desc() sign extends the return value because of integer promotion rules. For the most part, this doesn't matter, because the top bit of base2 is usually 0. If, however, that bit is 1, then the entire value will be 0x... which is probably not what the

Re: [PATCH] Make sure get_user_desc() doesn't sign extend.

2009-10-21 Thread Paolo Bonzini
On 10/21/2009 09:40 AM, Chris Lalancette wrote: The current implementation of get_user_desc() sign extends the return value because of integer promotion rules. For the most part, this doesn't matter, because the top bit of base2 is usually 0. If, however, that bit is 1, then the entire value