[PATCH 00/17] drm: rename various struct members "dev" -> "drm"

Thomas Zimmermann tzimmermann at suse.de
Thu Jul 13 14:08:43 UTC 2023


Hi

Am 13.07.23 um 15:11 schrieb Uwe Kleine-König:
> On Thu, Jul 13, 2023 at 12:41:15PM +0200, Thomas Zimmermann wrote:
>> Hi Uwe
>>
>> Am 13.07.23 um 12:22 schrieb Uwe Kleine-König:
>> [...]
>>>
>>> If that helps you: I plan to tackle these in a followup. I agree that's
>>> ugly, but fixing these in the same series is too much and if we agree
>>> that
>>>
>>> 	dev = crtc->dev;
>>>
>>> is ugly, there is then an intermediate state that either used
>>>
>>> 	drm = crtc->dev;
>>>
>>> or
>>>
>>> 	dev = crtc->drm;
>>>
>>> to finaly reach
>>>
>>> 	drm = crtc->drm;
>>>
>>> If you see a better way, please let me know. I don't see any.
>>
>> IF this renaming gets accepted, you could make a single patch
>> that adds a union with both names to all affected DRM data structures.
>>
>> struct drm_foo {
>>    union {
>>      struct drm_device *drm; // use this
>>      struct drm_device *dev; // don't use this
>>    };
>> }
>>
>> That patch prepares all of DRM for the renaming. And then you can go through
>> drivers one-by-one with a patch or a patchset for each to do all the
>> renaming there. Finally you send another DRM-wide patch to remove that
>> union.
>>
>> That would split the changes into smaller pieces without ugly intermediate
>> state. It also eases the problem for backporters and stable maintainers that
>> have to deal with the name changes.
>>
>> IIRC you already did something similar for remove or probe callbacks?
> 
> Did you look at patch #1 of the initial series? That's exactly what I
> did there. People argued to make a single patch and not use an anonymous
> union though ...

I would disagree with them. It also seemed to me that the concern but 
splitting up the change into multiple patches was about splitting up a 
DRM-wide change into multiple patches. If you'd do per-driver patchsets 
that cover all data structures, things might go different. OTOH I'm not 
sure if the rename is welcome at all.

Best regards
Thomas

> 
> Best regards
> Uwe
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230713/828ff790/attachment.sig>


More information about the dri-devel mailing list