lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210828085830.351-1-caihuoqing@baidu.com>
Date:   Sat, 28 Aug 2021 16:58:30 +0800
From:   Cai Huoqing <caihuoqing@...du.com>
To:     <bhelgaas@...gle.com>, <kbusch@...nel.org>
CC:     <linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Cai Huoqing <caihuoqing@...du.com>
Subject: [PATCH] PCI/portdrv: Make use of the helper macro SET_SYSTEM_SLEEP_PM_OPS()/ SET_RUNTIME_PM_OPS()

Use the helper macro SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS()
instead of the verbose operators ".runtime_suspend/_resume/_idle"
and ".suspend/.resume/.freeze/.thaw/.poweroff/.restore", because the
helper macro SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() could be
brought in to make code a little clearer, a little more concise.

Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
---
 drivers/pci/pcie/portdrv_pci.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index c7ff1eea225a..29d1c7de6410 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -70,17 +70,11 @@ static int pcie_port_runtime_idle(struct device *dev)
 }
 
 static const struct dev_pm_ops pcie_portdrv_pm_ops = {
-	.suspend	= pcie_port_device_suspend,
+	SET_SYSTEM_SLEEP_PM_OPS(pcie_port_device_suspend, pcie_port_device_resume)
+	SET_RUNTIME_PM_OPS(pcie_port_runtime_suspend,
+			   pcie_port_device_runtime_resume, pcie_port_runtime_idle)
 	.resume_noirq	= pcie_port_device_resume_noirq,
-	.resume		= pcie_port_device_resume,
-	.freeze		= pcie_port_device_suspend,
-	.thaw		= pcie_port_device_resume,
-	.poweroff	= pcie_port_device_suspend,
 	.restore_noirq	= pcie_port_device_resume_noirq,
-	.restore	= pcie_port_device_resume,
-	.runtime_suspend = pcie_port_runtime_suspend,
-	.runtime_resume	= pcie_port_device_runtime_resume,
-	.runtime_idle	= pcie_port_runtime_idle,
 };
 
 #define PCIE_PORTDRV_PM_OPS	(&pcie_portdrv_pm_ops)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ