mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
interconnect: qcom: lahaina: Stop using initializer macros
The current strategy of using macros to define/initialize structures causes a couple of problems. One is that it's difficult to navigate the code. Source navigators like cscope or ctags can't jump to structure definitions since they're buried inside macros. It's also difficult to see which structure members are getting initialized to which values, since one has to carefully compare the argument list with the macro definition to see which argument number gets assigned to which struct member. This is error prone. Another more serious problem is that it makes adding additional struct members to be initialized very difficult. If there's a new struct member that only needs to be initialized in a small number of cases, then we'd either need to update the common macro with a new parameter and then update every invocation of it, or create a new macro and only call the new macro in places where it's needed. The first method results in updating way more code than is necessary, especially if there are multiple old chipsets. The second method results in an explosion of different macros for each new member that needs initializing. To simplify this, don't use the macro initializers and instead just define the structures directly using designated initializers. If a new, uncommon field needs to be initialized, then one the small subsets of structures that care need to add the additional designated initializer and the rest can use sane defaults. Change-Id: I3a0ae58ba1fb1e838b5b587f94144a1ec1640f98 Signed-off-by: Mike Tipton <[email protected]>
This commit is contained in:
parent
ab470e82dd
commit
8c1b89af72
1 changed files with 2220 additions and 425 deletions
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue