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

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory



On 19/07/16 17:54, Tamas K Lengyel wrote:
> On Tue, Jul 19, 2016 at 10:49 AM, Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 19/07/16 17:27, Tamas K Lengyel wrote:
>>>>> +{
>>>>> +    int rc = 0;
>>>>> +    shr_handle_t sh, ch;
>>>>> +    unsigned long start =
>>>>> +        range->_scratchspace ? range->_scratchspace : range->start;
>>>> This can be shortened to "unsigned long start = range->_scratchspace ?:
>>>> range->start;" and fit on a single line.
>>> I'm not that familiar with this style of the syntax, does that have
>>> the effect of setting start = _scratchspace when _scratchspace is not
>>> 0?
>> It is a GCC extension
>> https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Conditionals.html which
>> allows you to omit the middle parameter if it is identical to the first.
> Are we OK with using syntax that is based on a compiler extension? I
> recall some cases where that was frowned upon (like using the 0b
> prefix).

We already use these all over the place.

The problem with 0b is that it isn't supported in all versions of GCC we
support.

~Andrew

_______________________________________________
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®.