aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-26 22:21:11 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-07-30 12:29:10 -0400
commitf6735590e9f441762ab5afeff64ded99e5b19a68 (patch)
tree58e15ba0d4c00195da9e9b199b7fc73de7f51e64 /drivers/pci/pcie
parent73cd3b43f08cc9a9bcb168994b8e9ebd983ff573 (diff)
PCI aerdrv: fix annoying warnings
Some compiler generates following warnings: In function 'aer_isr': warning: 'e_src.id' may be used uninitialized in this function warning: 'e_src.status' may be used uninitialized in this function Avoid status flag "int ret" and return constants instead, so that gcc sees the return value matching "it is initialized" better. Acked-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index 8af4f619bba2..fc0b5a93e1de 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -727,20 +727,21 @@ static void aer_isr_one_error(struct pcie_device *p_device,
727static int get_e_source(struct aer_rpc *rpc, struct aer_err_source *e_src) 727static int get_e_source(struct aer_rpc *rpc, struct aer_err_source *e_src)
728{ 728{
729 unsigned long flags; 729 unsigned long flags;
730 int ret = 0;
731 730
732 /* Lock access to Root error producer/consumer index */ 731 /* Lock access to Root error producer/consumer index */
733 spin_lock_irqsave(&rpc->e_lock, flags); 732 spin_lock_irqsave(&rpc->e_lock, flags);
734 if (rpc->prod_idx != rpc->cons_idx) { 733 if (rpc->prod_idx == rpc->cons_idx) {
735 *e_src = rpc->e_sources[rpc->cons_idx]; 734 spin_unlock_irqrestore(&rpc->e_lock, flags);
736 rpc->cons_idx++; 735 return 0;
737 if (rpc->cons_idx == AER_ERROR_SOURCES_MAX)
738 rpc->cons_idx = 0;
739 ret = 1;
740 } 736 }
737
738 *e_src = rpc->e_sources[rpc->cons_idx];
739 rpc->cons_idx++;
740 if (rpc->cons_idx == AER_ERROR_SOURCES_MAX)
741 rpc->cons_idx = 0;
741 spin_unlock_irqrestore(&rpc->e_lock, flags); 742 spin_unlock_irqrestore(&rpc->e_lock, flags);
742 743
743 return ret; 744 return 1;
744} 745}
745 746
746/** 747/**