-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
uwe5622: fix compilation with clang on Linux 6.19 #9314
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
uwe5622: fix compilation with clang on Linux 6.19 #9314
Conversation
In Linux 6.19, net_device->dev_addr is const unsigned char *. Clang with -Werror,-Wincompatible-pointer-types-discards-qualifiers rejects passing dev_addr to non-const parameters and memcpy into it. Fix by: - Replacing memcpy(dev->dev_addr, ...) with dev_addr_set() - Using local buffer + ether_addr_copy for sprdwl_set_mac_addr call that needs mutable addr (the function modifies it in-place) - Changing u8 *mac pointer to u8 mac[ETH_ALEN] array in cfg80211.c where dev_addr was assigned to a non-const pointer Relates to armbian#9049 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe changes add support for Linux kernel 6.19 to the wireless UWE5622 driver by introducing a conditional patch application in the compilation script and creating a new patch file that refactors MAC address handling to use kernel APIs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Disclaimer: I'm not familiar with compiler changes or clang. |
|
It still builds with gcc, for sure. |
|
✅ This PR has been reviewed and approved — all set for merge! |
In Linux 6.19, net_device->dev_addr is const unsigned char *. Clang with -Werror,-Wincompatible-pointer-types-discards-qualifiers rejects passing dev_addr to non-const parameters and memcpy into it.
Fix by:
Relates to #9049
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
build with clang
build with gcc
My code follows the style guidelines of this project
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
My changes generate no new warnings
Any dependent changes have been merged and published in downstream modules
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.