Re: [PATCH] x86/quirks: Cast PCI_D0 to u16 in apple_airport_reset()

From: Habil Eren Türker

Date: Thu Nov 19 2026 - 06:21:32 EST


Thank you both for the feedback. I agree that helper functions are a much
better approach than spreading (__force u16) casts throughout the code.

These are the main types of warnings (roughly 30 in total) in
drivers/pci, run with `make C=2 drivers/pci/`:

- warning: restricted pci_power_t degrades to integer (~25 instances)
- warning: incorrect type in assignment (different base types)
(~4 instances)
- warning: invalid assignment: |= (~3 instances)

The four helpers pci_power_t_get(), pci_power_t_set(), pci_power_eq()
and pci_power_gt() would cover all three groups.

I will prepare a v2 patch series that adds the helpers to
include/linux/pci.h and converts the call sites in drivers/pci/ and
arch/x86/kernel/early-quirks.c:

- Patch 1: add the helpers
- Patches 2-N: convert the call sites

Regards,
Türker