-
Notifications
You must be signed in to change notification settings - Fork 1
Merge changes #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
The macro changed to take a string argument, which cannot be backported easily Signed-off-by: Felix Fietkau <[email protected]>
Reviewer's GuideThis pull request introduces compatibility shims and backports functionality from newer Linux kernel versions (up to 6.14) by adding version-guarded helper functions and macros, adjusting symbol exports, and using a Coccinelle script to adapt driver callbacks for older kernels. Patch files were also updated. Sequence Diagram for platform_driver_remove Call on Kernels < 6.11sequenceDiagram
participant PC as Platform Core
participant PD as Platform Driver (struct)
participant Wrap as bp_platform_driver_remove_wrap
participant Orig as platform_driver_remove (original func)
Note over PC, Orig: On Kernel < 6.11
PC->>PD: Call driver.remove(dev)
activate PD
PD->>Wrap: dev.remove points to wrapper
activate Wrap
Wrap->>Orig: Call original remove function(dev)
activate Orig
Orig-->>Wrap: (Returns void)
deactivate Orig
Wrap-->>PD: Return 0
deactivate Wrap
PD-->>PC: Return 0
deactivate PD
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @kimocoder - I've reviewed your changes - here's some feedback:
- Consider updating the pull request title and description to summarize the changes.
- Consider explaining the addition and removal of patch files in the pull request description.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -385,4 +385,126 @@ MIN_LEN_VALIDATION(42) | |||
.range = (struct netlink_range_validation *)_range, \ | |||
} | |||
|
|||
#if LINUX_VERSION_IS_LESS(6,13,0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider using a macro to generate the nla_get_*_default functions.
You can reduce duplication by parameterizing the common pattern with a helper macro. For example, you might introduce a macro like this:
#define NLA_GET_DEFAULT(T, suffix, getter) \
static inline T nla_get_##suffix##_default(const struct nlattr *nla, T defvalue) { \
return (!nla) ? defvalue : getter(nla); \
}
Then instantiate it for all types:
NLA_GET_DEFAULT(u32, u32, nla_get_u32)
NLA_GET_DEFAULT(__be32, be32, nla_get_be32)
NLA_GET_DEFAULT(__le32, le32, nla_get_le32)
NLA_GET_DEFAULT(u16, u16, nla_get_u16)
NLA_GET_DEFAULT(__be16, be16, nla_get_be16)
NLA_GET_DEFAULT(__le16, le16, nla_get_le16)
NLA_GET_DEFAULT(u8, u8, nla_get_u8)
NLA_GET_DEFAULT(u64, u64, nla_get_u64)
NLA_GET_DEFAULT(__be64, be64, nla_get_be64)
NLA_GET_DEFAULT(__le64, le64, nla_get_le64)
NLA_GET_DEFAULT(s32, s32, nla_get_s32)
NLA_GET_DEFAULT(s16, s16, nla_get_s16)
NLA_GET_DEFAULT(s8, s8, nla_get_s8)
NLA_GET_DEFAULT(s64, s64, nla_get_s64)
NLA_GET_DEFAULT(__be32, in_addr, nla_get_in_addr)
NLA_GET_DEFAULT(unsigned long, msecs, nla_get_msecs)
This approach keeps the functionality intact while reducing redundancy and complexity in the file.
Summary by Sourcery
Add backport compatibility functions and macros for Linux kernel versions before 6.13 and 6.14
Enhancements:
Chores: