All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ptp-next] drivers/ptp: remove redundant variable
@ 2021-12-15  6:08 cgel.zte
  2021-12-15 14:42 ` Richard Cochran
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-12-15  6:08 UTC (permalink / raw)
  To: richardcochran; +Cc: netdev, linux-kernel, Minghao Chi, Zeal Robot

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH ptp-next] drivers/ptp: remove redundant variable
  2021-12-15  6:08 [PATCH ptp-next] drivers/ptp: remove redundant variable cgel.zte
@ 2021-12-15 14:42 ` Richard Cochran
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Cochran @ 2021-12-15 14:42 UTC (permalink / raw)
  To: cgel.zte; +Cc: netdev, linux-kernel, Minghao Chi, Zeal Robot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-15 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15  6:08 [PATCH ptp-next] drivers/ptp: remove redundant variable cgel.zte
2021-12-15 14:42 ` Richard Cochran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.