netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fec: Refactor: rename `adapter` to `fep`
@ 2022-12-22  9:49 Csókás Bence
  2022-12-23  2:16 ` Jakub Kicinski
  2023-02-06  0:03 ` [PATCH repost] " Csókás Bence
  0 siblings, 2 replies; 6+ messages in thread
From: Csókás Bence @ 2022-12-22  9:49 UTC (permalink / raw)
  To: netdev
  Cc: Richard Cochran, David S. Miller, Jakub Kicinski,
	qiangqing.zhang, Andrew Lunn, kernel, Csókás Bence

Commit 01b825f reverted a style fix, which renamed
`struct fec_enet_private *adapter` to `fep` to match
the rest of the driver. This commit factors out
that style fix.

Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
---
 drivers/net/ethernet/freescale/fec_ptp.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index ab86bb8562ef..afc658d2c271 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -443,21 +443,21 @@ static int fec_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  */
 static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
-	struct fec_enet_private *adapter =
+	struct fec_enet_private *fep =
 	    container_of(ptp, struct fec_enet_private, ptp_caps);
 	u64 ns;
 	unsigned long flags;
 
-	mutex_lock(&adapter->ptp_clk_mutex);
+	mutex_lock(&fep->ptp_clk_mutex);
 	/* Check the ptp clock */
-	if (!adapter->ptp_clk_on) {
-		mutex_unlock(&adapter->ptp_clk_mutex);
+	if (!fep->ptp_clk_on) {
+		mutex_unlock(&fep->ptp_clk_mutex);
 		return -EINVAL;
 	}
-	spin_lock_irqsave(&adapter->tmreg_lock, flags);
-	ns = timecounter_read(&adapter->tc);
-	spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
-	mutex_unlock(&adapter->ptp_clk_mutex);
+	spin_lock_irqsave(&fep->tmreg_lock, flags);
+	ns = timecounter_read(&fep->tc);
+	spin_unlock_irqrestore(&fep->tmreg_lock, flags);
+	mutex_unlock(&fep->ptp_clk_mutex);
 
 	*ts = ns_to_timespec64(ns);
 
-- 
2.25.1


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

* Re: [PATCH] net: fec: Refactor: rename `adapter` to `fep`
  2022-12-22  9:49 [PATCH] net: fec: Refactor: rename `adapter` to `fep` Csókás Bence
@ 2022-12-23  2:16 ` Jakub Kicinski
  2023-02-06  0:03 ` [PATCH repost] " Csókás Bence
  1 sibling, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2022-12-23  2:16 UTC (permalink / raw)
  To: Csókás Bence
  Cc: netdev, Richard Cochran, David S. Miller, qiangqing.zhang,
	Andrew Lunn, kernel

On Thu, 22 Dec 2022 10:49:52 +0100 Csókás Bence wrote:
> Commit 01b825f reverted a style fix, which renamed
> `struct fec_enet_private *adapter` to `fep` to match
> the rest of the driver. This commit factors out
> that style fix.

# Form letter - net-next is closed

We have already submitted the networking pull request to Linus
for v6.2 and therefore net-next is closed for new drivers, features,
code refactoring and optimizations. We are currently accepting
bug fixes only.

Please repost when net-next reopens after Jan 2nd.

RFC patches sent for review only are obviously welcome at any time.

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

* [PATCH repost] net: fec: Refactor: rename `adapter` to `fep`
  2022-12-22  9:49 [PATCH] net: fec: Refactor: rename `adapter` to `fep` Csókás Bence
  2022-12-23  2:16 ` Jakub Kicinski
@ 2023-02-06  0:03 ` Csókás Bence
  2023-02-07 11:46   ` Paolo Abeni
  1 sibling, 1 reply; 6+ messages in thread
From: Csókás Bence @ 2023-02-06  0:03 UTC (permalink / raw)
  To: netdev
  Cc: Richard Cochran, David S. Miller, Jakub Kicinski,
	qiangqing.zhang, Andrew Lunn, kernel

Commit 01b825f reverted a style fix, which renamed
`struct fec_enet_private *adapter` to `fep` to match
the rest of the driver. This commit factors out
that style fix.

Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
---
 drivers/net/ethernet/freescale/fec_ptp.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index ab86bb8562ef..afc658d2c271 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -443,21 +443,21 @@ static int fec_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  */
 static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
-       struct fec_enet_private *adapter =
+       struct fec_enet_private *fep =
             container_of(ptp, struct fec_enet_private, ptp_caps);
         u64 ns;
         unsigned long flags;
 
-       mutex_lock(&adapter->ptp_clk_mutex);
+       mutex_lock(&fep->ptp_clk_mutex);
         /* Check the ptp clock */
-       if (!adapter->ptp_clk_on) {
-               mutex_unlock(&adapter->ptp_clk_mutex);
+       if (!fep->ptp_clk_on) {
+               mutex_unlock(&fep->ptp_clk_mutex);
                 return -EINVAL;
         }
-       spin_lock_irqsave(&adapter->tmreg_lock, flags);
-       ns = timecounter_read(&adapter->tc);
-       spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
-       mutex_unlock(&adapter->ptp_clk_mutex);
+       spin_lock_irqsave(&fep->tmreg_lock, flags);
+       ns = timecounter_read(&fep->tc);
+       spin_unlock_irqrestore(&fep->tmreg_lock, flags);
+       mutex_unlock(&fep->ptp_clk_mutex);
 
         *ts = ns_to_timespec64(ns);
 
-- 
2.25.1

    

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

* Re: [PATCH repost] net: fec: Refactor: rename `adapter` to `fep`
  2023-02-06  0:03 ` [PATCH repost] " Csókás Bence
@ 2023-02-07 11:46   ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2023-02-07 11:46 UTC (permalink / raw)
  To: Csókás Bence, netdev
  Cc: Richard Cochran, David S. Miller, Jakub Kicinski,
	qiangqing.zhang, Andrew Lunn, kernel

Hello,

On Mon, 2023-02-06 at 00:03 +0000, Csókás Bence wrote:
> Commit 01b825f reverted a style fix, which renamed
> `struct fec_enet_private *adapter` to `fep` to match
> the rest of the driver. This commit factors out
> that style fix.
> 
> Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>

The patch does not apply cleanly to net-next (nor net, FWIS).

When referencing an existing commit you should use the:

<12 char hash> ("<commit tile>")

format.

More importantly, this kind of refactors are useful if you are going to
touch the relevant code with fixes or new feature in the same series,
otherwise they mainly produces later backport conflicts.

I'm not going to accept this kind of change, sorry.

Paolo


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

* Re: [PATCH] net: fec: Refactor: rename `adapter` to `fep`
  2023-05-15 11:47 [PATCH] " Csókás Bence
@ 2023-05-15 11:58 ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2023-05-15 11:58 UTC (permalink / raw)
  To: Csókás Bence
  Cc: netdev, Andrew Lunn, Richard Cochran, qiangqing.zhang, kernel,
	Jakub Kicinski, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

On 15.05.2023 13:47:21, Csókás Bence wrote:
> Commit 01b825f reverted a style fix, which renamed
> `struct fec_enet_private *adapter` to `fep` to match
> the rest of the driver.

That description is a bit misleading. In fact commit 01b825f997ac
("Revert "net: fec: Use a spinlock to guard `fep->ptp_clk_on`"")
reverted a patch that introduced a regression.

As a side effect the problematic patch b353b241f1eb ("net: fec: Use a
spinlock to guard `fep->ptp_clk_on`") renamed struct fec_enet_private
*adapter to fep to match the rest of the driver.

> This commit factors out
> that style fix.
> 
> Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [PATCH] net: fec: Refactor: rename `adapter` to `fep`
@ 2023-05-15 11:47 Csókás Bence
  2023-05-15 11:58 ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Csókás Bence @ 2023-05-15 11:47 UTC (permalink / raw)
  To: netdev
  Cc: Richard Cochran, David S. Miller, Jakub Kicinski,
	qiangqing.zhang, Andrew Lunn, kernel, Csókás Bence

Commit 01b825f reverted a style fix, which renamed
`struct fec_enet_private *adapter` to `fep` to match
the rest of the driver. This commit factors out
that style fix.

Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
---
 drivers/net/ethernet/freescale/fec_ptp.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index ab86bb8562ef..afc658d2c271 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -443,21 +443,21 @@ static int fec_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  */
 static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
-	struct fec_enet_private *adapter =
+	struct fec_enet_private *fep =
 	    container_of(ptp, struct fec_enet_private, ptp_caps);
 	u64 ns;
 	unsigned long flags;
 
-	mutex_lock(&adapter->ptp_clk_mutex);
+	mutex_lock(&fep->ptp_clk_mutex);
 	/* Check the ptp clock */
-	if (!adapter->ptp_clk_on) {
-		mutex_unlock(&adapter->ptp_clk_mutex);
+	if (!fep->ptp_clk_on) {
+		mutex_unlock(&fep->ptp_clk_mutex);
 		return -EINVAL;
 	}
-	spin_lock_irqsave(&adapter->tmreg_lock, flags);
-	ns = timecounter_read(&adapter->tc);
-	spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
-	mutex_unlock(&adapter->ptp_clk_mutex);
+	spin_lock_irqsave(&fep->tmreg_lock, flags);
+	ns = timecounter_read(&fep->tc);
+	spin_unlock_irqrestore(&fep->tmreg_lock, flags);
+	mutex_unlock(&fep->ptp_clk_mutex);
 
 	*ts = ns_to_timespec64(ns);
 
-- 
2.25.1



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

end of thread, other threads:[~2023-05-15 11:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  9:49 [PATCH] net: fec: Refactor: rename `adapter` to `fep` Csókás Bence
2022-12-23  2:16 ` Jakub Kicinski
2023-02-06  0:03 ` [PATCH repost] " Csókás Bence
2023-02-07 11:46   ` Paolo Abeni
2023-05-15 11:47 [PATCH] " Csókás Bence
2023-05-15 11:58 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).