Re:The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of ...
by atq2119 on Sunday October 11, 2020 @07:51PM
(#24750133)
Actually, there's a lot of commonality between those two files. Just look at all the "is_idle", "get_wptr", "set_wptr" type functions. They're either literally identical or the v2_0 version is a superset of functionality of the v1_0 version.
This is a case where code is identical not by random chance but due to an underlying logical pattern (in this case: ring buffers for communication between CPU and GPU seem to continue working the same way). Hiding that via code duplication is going to make the code overall less maintainable, because the code lacks implicit knowledge of these patterns.
P.S.: It's interesting how many people missed that my complaint was specifically not about the auto-generated part, but about the part that humans copy&paste.
Re:The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of ...
by flohofwoe on Monday October 12, 2020 @04:58AM
(#24752592)
Code duplication sometimes make sense to better decouple different parts of the code base, however that often only becomes apparent long after the "code cleanup" to remove duplicates has been done.
[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
[2] https://en.wikipedia.org/wiki/Video_Core_Next