Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/eeh: Cleanup unnecessary eeh_pe_state_mark_with_cfg()

The function eeh_pe_state_mark_with_cfg() just performs the work of
eeh_pe_state_mark() and then, conditionally, the work of
eeh_pe_state_clear(). However it is only ever called with a constant
state such that the condition is always true, so replace it by direct
calls.

Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Sam Bobroff and committed by
Michael Ellerman
eed4bdbe 54644927

+4 -24
+4 -2
arch/powerpc/kernel/eeh.c
··· 830 830 eeh_pe_state_clear(pe, EEH_PE_ISOLATED); 831 831 break; 832 832 case pcie_hot_reset: 833 - eeh_pe_state_mark_with_cfg(pe, EEH_PE_ISOLATED); 833 + eeh_pe_state_mark(pe, EEH_PE_ISOLATED); 834 + eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); 834 835 eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); 835 836 eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev); 836 837 if (!(pe->type & EEH_PE_VF)) ··· 839 838 eeh_ops->reset(pe, EEH_RESET_HOT); 840 839 break; 841 840 case pcie_warm_reset: 842 - eeh_pe_state_mark_with_cfg(pe, EEH_PE_ISOLATED); 841 + eeh_pe_state_mark(pe, EEH_PE_ISOLATED); 842 + eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); 843 843 eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); 844 844 eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev); 845 845 if (!(pe->type & EEH_PE_VF))
-22
arch/powerpc/kernel/eeh_pe.c
··· 670 670 eeh_pe_traverse(pe, __eeh_pe_state_clear, &state); 671 671 } 672 672 673 - /** 674 - * eeh_pe_state_mark_with_cfg - Mark PE state with unblocked config space 675 - * @pe: PE 676 - * @state: PE state to be set 677 - * 678 - * Set specified flag to PE and its child PEs. The PCI config space 679 - * of some PEs is blocked automatically when EEH_PE_ISOLATED is set, 680 - * which isn't needed in some situations. The function allows to set 681 - * the specified flag to indicated PEs without blocking their PCI 682 - * config space. 683 - */ 684 - void eeh_pe_state_mark_with_cfg(struct eeh_pe *pe, int state) 685 - { 686 - eeh_pe_traverse(pe, __eeh_pe_state_mark, &state); 687 - if (!(state & EEH_PE_ISOLATED)) 688 - return; 689 - 690 - /* Clear EEH_PE_CFG_BLOCKED, which might be set just now */ 691 - state = EEH_PE_CFG_BLOCKED; 692 - eeh_pe_traverse(pe, __eeh_pe_state_clear, &state); 693 - } 694 - 695 673 /* 696 674 * Some PCI bridges (e.g. PLX bridges) have primary/secondary 697 675 * buses assigned explicitly by firmware, and we probably have