On 29.09.21 11:36, Jan Beulich wrote:
> On 29.09.2021 10:24, Oleksandr Andrushchenko wrote:
>> On 29.09.21 11:16, Jan Beulich wrote:
>>> On 29.09.2021 10:13, Michal Orzel wrote:
>>>> On 23.09.2021 14:54, Oleksandr Andrushchenko wrote:
>>>>> @@ -149,6 +172,10 @@ bool vpci_process_pending(struct vcpu *v)
>>>>> if ( !bar->mem )
>>>>> continue;
>>>>>
>>>>> + data.start_gfn = is_hardware_domain(v->vpci.pdev->domain) ?
>>>>> + _gfn(PFN_DOWN(bar->addr)) :
>>>>> + _gfn(PFN_DOWN(bar->guest_addr));
>>>> I believe this would look better with the following alignment:
>>>> data.start_gfn = is_hardware_domain(v->vpci.pdev->domain)
>>>> ? _gfn(PFN_DOWN(bar->addr))
>>>> : _gfn(PFN_DOWN(bar->guest_addr));
>>> FWIW I agree, yet personally I think the conditional operator here
>>> even wants to move inside the _gfn(PFN_DOWN()).
>> I can do it as well:
>>
>> data.start_gfn = _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain) ?
>> bar->addr : bar->guest_addr))
>> But, help me please breaking it into multiline with 80 chars respected
> Besides the option of latching v->vpci.pdev->domain or
> is_hardware_domain(v->vpci.pdev->domain) into a helper variable,
>
> data.start_gfn =
> _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
> ? bar->addr : bar->guest_addr));
I'll go with this one, thank you
>
> or
>
> data.start_gfn =
> _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
> ? bar->addr
> : bar->guest_addr));
>
> Jan
>