Re: [PATCH 11/11] video/aperture: Only remove sysfb on the default vga pci device

From: Javier Martinez Canillas
Date: Wed Jan 11 2023 - 11:44:56 EST


On 1/11/23 17:20, Thomas Zimmermann wrote:

[...]

>>
>> diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c
>> index ba565515480d..a1821d369bb1 100644
>> --- a/drivers/video/aperture.c
>> +++ b/drivers/video/aperture.c
>> @@ -321,15 +321,16 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na
>>
>> primary = pdev == vga_default_device();
>>
>> + if (primary)
>> + sysfb_disable();
>> +
>
> There's another sysfb_disable() in aperture_remove_conflicting_devices()
> without the branch but with a long comment. I find this slightly confusing.
>
> I'd rather add a branched sysfb_disable() plus the comment to
> aperture_detach_devices(). And then add a 'primary' parameter to
> aperture_detach_devices(). In aperture_remove_conflicting_devices() the
> parameter would be unconditionally true.
>

Or just remove that long comment since there's already kernel-doc for the
sysfb_disable() function definition.

This feels to me that any approach to parameterize this will lead to code
that is harder to read.

Since is just a single function call, I would just duplicate like $subject
does to be honest.

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat