mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: richardcochran@gmail.com
Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
	davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>, CGEL ZTE <cgel.zte@gmail.com>
Subject: [PATCH] drivers/net/phy/dp83640: remove unneeded val variable
Date: Tue, 18 Jan 2022 07:54:38 +0000	[thread overview]
Message-ID: <20220118075438.925768-1-chi.minghao@zte.com.cn> (raw)

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

Return value from phy_read() 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>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 drivers/net/phy/dp83640.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index c2d1a85ec559..4159e7cdc92c 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -226,15 +226,13 @@ static inline int broadcast_write(struct phy_device *phydev, u32 regnum,
 static int ext_read(struct phy_device *phydev, int page, u32 regnum)
 {
 	struct dp83640_private *dp83640 = phydev->priv;
-	int val;
 
 	if (dp83640->clock->page != page) {
 		broadcast_write(phydev, PAGESEL, page);
 		dp83640->clock->page = page;
 	}
-	val = phy_read(phydev, regnum);
 
-	return val;
+	return phy_read(phydev, regnum);
 }
 
 /* Caller must hold extreg_lock. */
-- 
2.25.1


             reply	other threads:[~2022-01-18  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18  7:54 cgel.zte [this message]
2022-01-18 15:19 ` Richard Cochran
2022-01-18 17:15   ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220118075438.925768-1-chi.minghao@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=chi.minghao@zte.com.cn \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®