Skip to content

Commit 9661e78

Browse files
andy-shevbjorn-helgaas
authored andcommitted
PCI / PM: Enforce type casting for pci_power_t
When casting variables of type pci_power_t, a static analysis tool complains: include/linux/pci.h:119:37: warning: cast from restricted pci_power_t Enforce type casting to make the static analyzer happy. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent af8c34c commit 9661e78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ extern const char *pci_power_names[];
116116

117117
static inline const char *pci_power_name(pci_power_t state)
118118
{
119-
return pci_power_names[1 + (int) state];
119+
return pci_power_names[1 + (__force int) state];
120120
}
121121

122122
#define PCI_PM_D2_DELAY 200

0 commit comments

Comments
 (0)