From 1267b3a325f00291e847ea4a001ccabe5d5516f2 Mon Sep 17 00:00:00 2001 From: Chunhe Lan Date: Wed, 7 Mar 2012 15:16:26 +0800 Subject: PCI: fix uninitialized variable 'cap_mask' 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 Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/portdrv_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pci') diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 2f589a54f9bd..75915b30ad19 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -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) -- cgit v1.2.3