Re: [PATCH v2 1/4] PCI: Add pci_power_t helper functions

From: Bjorn Helgaas

Date: Thu Nov 19 2026 - 12:08:13 EST


On Thu, Nov 19, 2026 at 06:51:06PM +0200, andriy.shevchenko@xxxxxxxxx wrote:
> On Thu, Nov 19, 2026 at 02:35:46PM +0000, Habil Eren Türker wrote:
> > Add helper functions to extract, set and compare PCI power
> > states in the Power Management Control/Status register.
> ...

> > +/* Helper functions for PCI power management */
> > +static inline pci_power_t pci_power_t_get(u32 csr)
>
> Why u32 as it seems the value is 16-bit?

I think there's one reader of PCI_PM_CTRL that does a 32-bit read, and
I figured a u16->u32 promotion would be better than a u32->u16
truncation. But maybe that reader should be changed to a 16-bit read.