Skip to content

Remove dead code - #276

Merged
Ghoul4500 merged 17 commits into
OpenGamingCollective:mainfrom
Ghoul4500:remove-dead-code
Aug 7, 2026
Merged

Remove dead code#276
Ghoul4500 merged 17 commits into
OpenGamingCollective:mainfrom
Ghoul4500:remove-dead-code

Conversation

@Ghoul4500

Copy link
Copy Markdown
Member

Description

Removes dead code throughout the codebase

Tested Hardware & Environment

  • ASUS Laptop Model: ROG STRIX Scar 18 2025 (G835LW)
  • Linux Distribution: Arch Linux
  • Kernel Version: 7.1.5-arch1-2

Verification and testing:

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project (cargo fmt --all -- --check)
  • My changes generate no new warnings (cargo clippy --all -- -D warnings/cargo check --all-targets)
  • New and existing unit tests pass locally with my changes (cargo test --all)
  • Cranky with 0 warning (cargo cranky)

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 01345dba-4601-4203-aa3f-90cd6d4d5e0d

📥 Commits

Reviewing files that changed from the base of the PR and between e7df203 and 5b3ce17.

📒 Files selected for processing (14)
  • asusctl/examples/anime-diag-png.rs
  • asusctl/examples/anime-diag.rs
  • asusctl/src/aura_cli.rs
  • asusctl/src/main.rs
  • rog-anime/src/diagonal.rs
  • rog-anime/src/gif.rs
  • rog-anime/src/sequencer.rs
  • rog-anime/tests/g635l.rs
  • rog-anime/tests/g835l.rs
  • rog-anime/tests/ga401.rs
  • rog-anime/tests/ga402q.rs
  • rog-anime/tests/gu604.rs
  • rog-control-center/src/ui/setup_system.rs
  • rog-platform/src/gpu_pci.rs
💤 Files with no reviewable changes (3)
  • asusctl/examples/anime-diag-png.rs
  • asusctl/src/aura_cli.rs
  • rog-platform/src/gpu_pci.rs
📜 Recent review details
🔇 Additional comments (11)
rog-control-center/src/ui/setup_system.rs (1)

200-203: LGTM!

Also applies to: 250-264, 290-304, 724-806

rog-anime/src/diagonal.rs (1)

3-4: LGTM!

Also applies to: 13-20, 45-45, 54-54

rog-anime/src/gif.rs (1)

105-105: LGTM!

Also applies to: 159-159

rog-anime/src/sequencer.rs (1)

86-86: LGTM!

asusctl/examples/anime-diag.rs (1)

19-19: LGTM!

asusctl/src/main.rs (1)

409-410: LGTM!

rog-anime/tests/g635l.rs (1)

226-226: LGTM!

Also applies to: 336-336

rog-anime/tests/g835l.rs (1)

226-226: LGTM!

Also applies to: 336-336

rog-anime/tests/ga401.rs (1)

232-232: LGTM!

rog-anime/tests/ga402q.rs (1)

323-323: LGTM!

Also applies to: 483-483

rog-anime/tests/gu604.rs (1)

323-323: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Removed numerous unused public helpers and accessors across lighting, keyboard, GPU, shortcut, profile, USB, and device-management features.
    • Simplified GPU status reporting while preserving power-state information.
    • Removed obsolete PCI rescanning, device wake-management, layout discovery, and hardware classification interfaces.
    • Simplified diagonal anime image handling by removing unused duration settings.
    • Streamlined control-center value handling without changing Armoury attribute behavior.
    • Retained supported status and mutation APIs where applicable, including GPU power status, shortcut status, and USB packet access.

Walkthrough

This PR removes unused public APIs across multiple crates. It also simplifies anime construction, direct UI value wiring, GPU vendor tracking, and GPU power-status propagation.

Changes

API and platform cleanup

Layer / File(s) Summary
Simplify anime diagonal construction
rog-anime/src/diagonal.rs, rog-anime/src/gif.rs, rog-anime/src/sequencer.rs, asusctl/..., rog-anime/tests/*
AnimeDiagonal no longer stores duration. Its constructors, PNG loading, callers, examples, and tests use the reduced signatures.
Simplify GPU discovery and status
rog-platform/src/gpu_pci.rs, rog-platform/tests/gpu_pci_tests.rs, rog-control-center/src/main.rs
GfxVendor and vendor storage are removed. GPU discovery retains PCI ID-based detection. get_gpu_power_status() returns GfxPower, and the control-center channel forwards the complete value.
Use direct UI and D-Bus values
rog-control-center/src/ui/setup_system.rs
Property macros and Armoury attribute wiring pass values directly without explicit conversion arguments.
Remove obsolete public helpers
asusd/src/aura_laptop/config.rs, rog-aura/..., rog-anime/src/grid.rs, rog-dbus/src/lib.rs, rog-profiles/src/lib.rs, rog-scsi/..., rog-slash/src/usb.rs
Unused accessors, constructors, layout helpers, mode helpers, D-Bus queries, profile lookup, and USB helpers are removed.
Remove unused device state and accessors
rog-platform/src/hid_raw.rs, rog-platform/src/asus_armoury.rs, rog-control-center/src/shortcuts.rs, rog-control-center/src/main.rs
Unused HID sysfs state, wakeup updates, mutable firmware access, shortcut status access, layout path construction, and unused imports are removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GPUDiscovery
  participant get_gpu_power_status
  participant ControlCenter
  GPUDiscovery->>get_gpu_power_status: discover GPU state
  get_gpu_power_status->>ControlCenter: return GfxPower
  ControlCenter->>ControlCenter: publish complete status value
Loading

Possibly related PRs

Suggested labels: asusd, asusctl, rog-control-center, rog-aura, rog-anime, rog-platform, rog-profiles, rog-scsi, rog-slash

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the primary change: removing unused code throughout the codebase.
Description check ✅ Passed The description includes the change summary, tested environment, and most required verification results; unchecked documentation items are non-critical.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@Ghoul4500 Ghoul4500 self-assigned this Aug 7, 2026
@coderabbitai coderabbitai Bot added asusd System Daemon / D-Bus rog-anime AniMe Matrix Display rog-aura Keyboard / Aura RGB rog-control-center ROG Control Center GUI rog-platform GPU Switching / Armoury / WMI rog-profiles Power Profiles / Fan Curves rog-scsi Drive / SCSI LED rog-slash Slash LED Bar labels Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rog-platform/src/gpu_pci.rs`:
- Line 269: Centralize AMD and NVIDIA PCI vendor classification in the existing
vendor-prefix constants. Update get_gpu_names to use the same constants as the
dgpu check around AMD_PCI_VENDOR, preserving its current case-insensitive
matching behavior and removing the hardcoded "1002" and "10DE" values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a16562fa-39ac-455d-a3f5-d70e76674d77

📥 Commits

Reviewing files that changed from the base of the PR and between d23d0cc and cc98c28.

📒 Files selected for processing (19)
  • asusd/src/aura_laptop/config.rs
  • asusd/src/ctrl_platform.rs
  • rog-anime/src/grid.rs
  • rog-aura/src/builtin_modes.rs
  • rog-aura/src/keyboard/advanced.rs
  • rog-aura/src/keyboard/layouts.rs
  • rog-aura/src/lib.rs
  • rog-control-center/src/main.rs
  • rog-control-center/src/shortcuts.rs
  • rog-dbus/src/lib.rs
  • rog-platform/src/asus_armoury.rs
  • rog-platform/src/gpu_pci.rs
  • rog-platform/src/hid_raw.rs
  • rog-platform/src/platform.rs
  • rog-platform/tests/gpu_pci_tests.rs
  • rog-profiles/src/lib.rs
  • rog-scsi/src/builtin_modes.rs
  • rog-scsi/src/sg.rs
  • rog-slash/src/usb.rs
💤 Files with no reviewable changes (16)
  • asusd/src/aura_laptop/config.rs
  • rog-profiles/src/lib.rs
  • asusd/src/ctrl_platform.rs
  • rog-aura/src/builtin_modes.rs
  • rog-slash/src/usb.rs
  • rog-dbus/src/lib.rs
  • rog-anime/src/grid.rs
  • rog-aura/src/keyboard/advanced.rs
  • rog-control-center/src/shortcuts.rs
  • rog-platform/src/hid_raw.rs
  • rog-scsi/src/builtin_modes.rs
  • rog-aura/src/lib.rs
  • rog-platform/src/asus_armoury.rs
  • rog-platform/src/platform.rs
  • rog-scsi/src/sg.rs
  • rog-aura/src/keyboard/layouts.rs
📜 Review details
🔇 Additional comments (6)
rog-platform/tests/gpu_pci_tests.rs (1)

8-8: LGTM!

rog-platform/src/gpu_pci.rs (4)

252-321: LGTM!


654-661: LGTM!

Also applies to: 755-755


411-436: 🚀 Performance & Scalability

Keep this as-is. get_gpu_power_status() runs only during watch-channel initialization. notify.rs caches the dGPU and rereads runtime_status every 1.5 seconds, with full detection only when needed.

			> Likely an incorrect or invalid review comment.

162-185: 🗄️ Data Integrity & Integration

No in-repository references to GfxVendor or Device::vendor() remain. The removal is safe for current workspace consumers.

rog-control-center/src/main.rs (1)

176-176: LGTM!

Comment thread rog-platform/src/gpu_pci.rs
@coderabbitai coderabbitai Bot added the asusctl CLI Tool label Aug 7, 2026
@Ghoul4500
Ghoul4500 merged commit 61c39ff into OpenGamingCollective:main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asusctl CLI Tool asusd System Daemon / D-Bus rog-anime AniMe Matrix Display rog-aura Keyboard / Aura RGB rog-control-center ROG Control Center GUI rog-platform GPU Switching / Armoury / WMI rog-profiles Power Profiles / Fan Curves rog-scsi Drive / SCSI LED rog-slash Slash LED Bar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant