diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2015-08-27 07:58:27 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-10-15 11:31:58 +0200 |
commit | 54f9a64a36e4fc041721a954e674797c2686ea4e (patch) | |
tree | 1e2e5df84aa1ab4282db37c4fa653fb04e506756 /arch/powerpc/kernel/eeh.c | |
parent | cxl: Free virtual PHB when removing (diff) | |
download | linux-54f9a64a36e4fc041721a954e674797c2686ea4e.tar.xz linux-54f9a64a36e4fc041721a954e674797c2686ea4e.zip |
powerpc/eeh: atomic_dec_if_positive() to update passthru count
No need to have two atomic opertions (update and fetch/check) when
decreasing PE's number of passed devices as one atomic operation
is enough.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/eeh.c')
-rw-r--r-- | arch/powerpc/kernel/eeh.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 00ba5de12256..893978c980da 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c @@ -1412,8 +1412,7 @@ void eeh_dev_release(struct pci_dev *pdev) goto out; /* Decrease PE's pass through count */ - atomic_dec(&edev->pe->pass_dev_cnt); - WARN_ON(atomic_read(&edev->pe->pass_dev_cnt) < 0); + WARN_ON(atomic_dec_if_positive(&edev->pe->pass_dev_cnt) < 0); eeh_pe_change_owner(edev->pe); out: mutex_unlock(&eeh_dev_mutex); |