[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 04/16] xen/x86: p2m-pod: Fix coding style



>>> Julien Grall <julien.grall@xxxxxxx> 09/28/17 9:30 PM >>>
>On 09/22/2017 10:15 AM, Jan Beulich wrote:
>>>>> On 21.09.17 at 14:40, <julien.grall@xxxxxxx> wrote:
>>> Also take the opportunity to:
>>>      - move from 1 << * to 1UL << *.
>>>      - use unsigned when possible
>>>      - move from unsigned int -> unsigned long for some induction
>>>      variables
>> 
>> I don't understand this last point, btw - the largest order page the
>> code needs to deal with right now is 1Gb, so there's no risk of
>> overflow (yet). But you've got George's and Andrew's ack, so no
>> need to revise this...
>
>The last one result from the existing 1UL << in the code. We have place 
>where the induction variable is unsigned int but the shift unsigned long.

In which case I would have suggested to change the shift to use 1U, since ...

>Similarly the code is using a mix of 1 << and 1UL <<. I moved to UL 
>because even if the code only support up to 1GB superpage at the moment, 
>it would be pain to find all the places the day we decide to use bigger one.

... I doubt this would be too hard. But in the end it's George to judge anyway.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.