[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 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). Tamas _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |