Re: [PATCH] x86/quirks: Cast PCI_D0 to u16 in apple_airport_reset()
From: andriy.shevchenko@xxxxxxxxx
Date: Thu Nov 19 2026 - 06:41:55 EST
On Thu, Nov 19, 2026 at 11:21:25AM +0000, Habil Eren Türker wrote:
> 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.
For the completeness the _lt() also needed, with that we will cover all
<, >, <=, and >=.
--
With Best Regards,
Andy Shevchenko