rockchip64: fix clang -Wincompatible-pointer-types-discards-qualifiers in carried patches#10140
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughUpdates repeated kernel patch files to cast Changesbus_format cast fix
DisplayPort HPD extcon notification
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant dp_altmode_status_update as dp_altmode_status_update
participant dp_altmode_update_extcon_hpd_status as dp_altmode_update_extcon_hpd_status
participant OF device chain as OF device chain
participant extcon device as extcon device
dp_altmode_status_update->>dp_altmode_update_extcon_hpd_status: update HPD state
dp_altmode_update_extcon_hpd_status->>dp_altmode_update_extcon_hpd_status: check cached dp->hpd
dp_altmode_update_extcon_hpd_status->>OF device chain: walk parent OF nodes
OF device chain-->>dp_altmode_update_extcon_hpd_status: extcon node / phandle
dp_altmode_update_extcon_hpd_status->>extcon device: check EXTCON_DISP_HPD capability
dp_altmode_update_extcon_hpd_status->>extcon device: set EXTCON_PROP_DISP_HPD and sync
Suggested reviewers: 🚥 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 |
56210c1 to
ed783ab
Compare
…discards-qualifiers of_get_drm_display_mode() takes u32 *bus_format, but the patch passed &p->desc->bus_format where desc is const struct panel_desc *. GCC tolerates this; clang rejects it under -Werror since the removal of the blanket -Wno-error=unknown-warning-option from KCFLAGS. The pointed-to memory is actually writable (desc is allocated via devm_kmemdup in this driver), so cast the constness away at the call site. Applied to rockchip64-6.6/6.12/6.18/7.1; the 7.2 copy of the patch is .disabled and left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pes-discards-qualifiers extcon_get_edev_by_phandle() takes struct device * (non-const), but the patch declared the local as const struct device *. Drop the const: &dp->alt->dev is a non-const pointer anyway, and the 7.1/7.2 copies of this patch already use the non-const form. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ed783ab to
ee3f016
Compare
igorpecovnik
approved these changes
Jul 9, 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
Two carried rockchip64 kernel patches assign a
constpointer to a non-const one, which clang rejects under-Werror,-Wincompatible-pointer-types-discards-qualifiers:general-add-panel-simple-dsi.patch:of_get_drm_display_mode(..., &p->desc->bus_format, ...)—descisconst.rk3399-usbc-notify-typec-dp-hpd-state-through-extcon.patch:const struct device *dev = &dp->alt->dev;is passed toextcon_get_edev_by_phandle(), which takes a non-conststruct device *.Fix:
(u32 *)&p->desc->bus_format— the pointed-to memory is writable (adevm_kmemdupcopy), only the pointer type isconst. Replicated torockchip64-{6.6,6.12,6.18,7.1}(7.2 has the patch.disabled).conston the localdev(6.18 only; 6.6/6.12 don't carry this patch, 7.1/7.2 already use the non-const form).Behaviour-preserving; GCC was already silent on both.
How Has This Been Tested?
rockchip64 clang build (armsom-sige5) — both files compile clean under clang.
Checklist:
Summary by CodeRabbit