Skip to content

Commit

Permalink
PCI: fix uninitialized variable 'cap_mask'
Browse files Browse the repository at this point in the history
Get rid of these:

drivers/pci/pcie/portdrv_core.c: In function 'pcie_port_device_register':
drivers/pci/pcie/portdrv_core.c:275:16: warning: 'cap_mask' may be used
uninitialized in this function [-Wuninitialized]
drivers/pci/pcie/portdrv_core.c:240:6: note: 'cap_mask' was declared here

In some cases, 'cap_mask' may be not set in pcie_port_platform_notify,
holding a garbage value.

Signed-off-by: Chunhe Lan <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
  • Loading branch information
Chunhe Lan authored and bjorn-helgaas committed May 7, 2012
1 parent 0cbaa57 commit 1267b3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pcie/portdrv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int get_port_device_capability(struct pci_dev *dev)
int services = 0, pos;
u16 reg16;
u32 reg32;
int cap_mask;
int cap_mask = 0;
int err;

if (pcie_ports_disabled)
Expand Down

0 comments on commit 1267b3a

Please sign in to comment.