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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211215060825.442247-1-chi.minghao@zte.com.cn>
Date:   Wed, 15 Dec 2021 06:08:25 +0000
From:   cgel.zte@...il.com
To:     richardcochran@...il.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH ptp-next] drivers/ptp: remove redundant variable

From: Minghao Chi <chi.minghao@....com.cn>

Return value directly instead of taking this
in another redundant variable.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
 drivers/ptp/ptp_pch.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 8070f3fd98f0..9132aaa70a2d 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -193,11 +193,8 @@ EXPORT_SYMBOL(pch_ch_control_write);
 u32 pch_ch_event_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
-	u32 val;
-
-	val = ioread32(&chip->regs->ch_event);
 
-	return val;
+	return ioread32(&chip->regs->ch_event);
 }
 EXPORT_SYMBOL(pch_ch_event_read);
 
@@ -212,22 +209,16 @@ EXPORT_SYMBOL(pch_ch_event_write);
 u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
-	u32 val;
 
-	val = ioread32(&chip->regs->src_uuid_lo);
-
-	return val;
+	return ioread32(&chip->regs->src_uuid_lo);
 }
 EXPORT_SYMBOL(pch_src_uuid_lo_read);
 
 u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
-	u32 val;
 
-	val = ioread32(&chip->regs->src_uuid_hi);
-
-	return val;
+	return ioread32(&chip->regs->src_uuid_hi);
 }
 EXPORT_SYMBOL(pch_src_uuid_hi_read);
 
@@ -663,12 +654,9 @@ static void __exit ptp_pch_exit(void)
 
 static s32 __init ptp_pch_init(void)
 {
-	s32 ret;
-
 	/* register the driver with the pci core */
-	ret = pci_register_driver(&pch_driver);
 
-	return ret;
+	return pci_register_driver(&pch_driver);
 }
 
 module_init(ptp_pch_init);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ