rockchip64: fix clang -Wincompatible-pointer-types-discards-qualifiers in carried patches#10140
rockchip64: fix clang -Wincompatible-pointer-types-discards-qualifiers in carried patches#10140iav wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 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 |
…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>
56210c1 to
ed783ab
Compare
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
New Features
Bug Fixes