[Deepin-Kernel-SIG] [linux 6.18.y] [FROMLIST] USB: cdc-acm: Fix bit overlap and move quirk definitions to header#1663
Conversation
The VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flags added in
commit f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10
INGENIC touchscreen") were placed inside the acm_ctrl_msg() function
rather than in the header with the other quirk flags. Worse, their
values (BIT(9) and BIT(10)) collided with NO_UNION_12 which is already
BIT(9).
Move the definitions to drivers/usb/class/cdc-acm.h where they belong
and shift them to BIT(10) and BIT(11) to avoid the overlap.
Fixes: f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
(cherry picked from commit 12b9827)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideMoves recently added cdc-acm quirk flags into the shared header and adjusts their bit positions to avoid overlap with existing flags, keeping all quirk definitions centralized and non-conflicting. Class diagram for centralized cdc_acm quirk flags in headerclassDiagram
class cdc_acm_quirk_flags {
+BIT7 DISABLE_ECHO
+BIT8 MISSING_CAP_BRK
+BIT9 NO_UNION_12
+BIT10 VENDOR_CLASS_DATA_IFACE
+BIT11 ALWAYS_POLL_CTRL
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Avenger-285714 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Fixes a quirk-flag bit collision in the cdc-acm USB class driver by moving two quirk definitions into the shared header alongside the other quirk flags and reassigning them to non-overlapping bit positions.
Changes:
- Move
VENDOR_CLASS_DATA_IFACEandALWAYS_POLL_CTRLquirk flag definitions out ofacm_ctrl_msg()intodrivers/usb/class/cdc-acm.h. - Shift the two quirk flag bit positions to
BIT(10)andBIT(11)to avoid overlapping withNO_UNION_12(BIT(9)).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| drivers/usb/class/cdc-acm.h | Centralizes the two quirk flag definitions with the existing quirk bitmask and updates them to non-overlapping bit positions. |
| drivers/usb/class/cdc-acm.c | Removes the in-function quirk #defines so the driver consistently consumes quirk definitions from the header. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flags added in commit f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen") were placed inside the acm_ctrl_msg() function rather than in the header with the other quirk flags. Worse, their values (BIT(9) and BIT(10)) collided with NO_UNION_12 which is already BIT(9).
Move the definitions to drivers/usb/class/cdc-acm.h where they belong and shift them to BIT(10) and BIT(11) to avoid the overlap.
Fixes: f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen")
Cc: stable@vger.kernel.org
(cherry picked from commit 12b9827)
Summary by Sourcery
Fix cdc-acm USB quirk flag definitions to avoid bit overlap and centralize them in the shared header.
Bug Fixes:
Enhancements: