Skip to content

Commit

Permalink
PCI / PM: Enforce type casting for pci_power_t
Browse files Browse the repository at this point in the history
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 <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Andy Shevchenko authored and Bjorn Helgaas committed Jun 13, 2016
1 parent af8c34c commit 9661e78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern const char *pci_power_names[];

static inline const char *pci_power_name(pci_power_t state)
{
return pci_power_names[1 + (int) state];
return pci_power_names[1 + (__force int) state];
}

#define PCI_PM_D2_DELAY 200
Expand Down

0 comments on commit 9661e78

Please sign in to comment.