spacemit: rtl8852bs: guard GCC-only warning flags for clang builds#10139
Merged
Conversation
The in-tree rtl8852bs Makefile adds -Wno-restrict and -Wno-old-style-declaration unconditionally. clang rejects these GCC-only options and the kernel's -Werror=unknown-warning-option makes it fatal, breaking every clang kernel build for spacemit (rtl8852bs is in-tree there, EXTRAWIFI is forced off in the family config). Wrap both flags in $(call cc-disable-warning, ...) so each is added only for compilers that know the positive warning name (GCC), robust against a ccache CC prefix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
📝 WalkthroughWalkthroughThis change modifies a kernel patch file for the rtl8852bs wireless driver Makefile, converting unconditional GCC-only warning suppression flags (-Wno-restrict, -Wno-old-style-declaration) into conditional flags using cc-disable-warning, avoiding build failures on clang. Changesrtl8852bs Patch Update
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
2 tasks
pyavitz
approved these changes
Jul 7, 2026
Contributor
|
✅ This PR has been reviewed and approved — all set for merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The rtl8852bs driver bundled in the spacemit vendor kernel adds two GCC-only warning options unconditionally in its
Makefile:clang does not know these options, and with the kernel's
-Werror=unknown-warning-optionthe build fails:On the
spacemitfamily the driver is in-tree andEXTRAWIFIis forced off in the family config, so it cannot be excluded — this breaks every clang kernel build for the family.Fix: wrap the two GCC-only flags in
$(call cc-disable-warning, ...), so each is added only for a compiler that understands the positive warning name (GCC). This is also robust againstCCcarrying accacheprefix, unlike theifeq ($(CC), clang)compare further down the same Makefile. The remaining-Wno-*in that block (unused,empty-body,missing-prototypes,missing-declarations) are understood by clang and left untouched. GCC behaviour is unchanged.How Has This Been Tested?
Kernel build for
bananapif3(spacemit, kernel 6.18):8852bs.ko+linux-image.deb — 0 errors.8852bs.kobuilt under clang, 0unknown-warning-option/ 0 errors,linux-image.deb produced.Repro:
Checklist:
Summary by CodeRabbit