diff mbox series

[ptp-next] drivers/ptp: remove redundant variable

Message ID 20211215060825.442247-1-chi.minghao@zte.com.cn (mailing list archive)
State Rejected
Headers show
Series [ptp-next] drivers/ptp: remove redundant variable | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 2 of 2 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 49 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

CGEL Dec. 15, 2021, 6:08 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

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

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

Comments

Richard Cochran Dec. 15, 2021, 2:42 p.m. UTC | #1
On Wed, Dec 15, 2021 at 06:08:25AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return value directly instead of taking this
> in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>

NAK.  The original version is fine as it.  Please teach your robot not
to generate churn.

Thanks,
Richard
diff mbox series

Patch

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);