lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH ptp-next] drivers/ptp: remove redundant variable
Date
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(-)

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
\
 
 \ /
  Last update: 2021-12-15 07:09    [W:0.038 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site