netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] net: ethernet: Simplify few things
@ 2025-01-12 13:32 Krzysztof Kozlowski
  2025-01-12 13:32 ` [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses Krzysztof Kozlowski
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:32 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx,
	Krzysztof Kozlowski

Few code simplifications without functional impact.  Not tested on
hardware.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (5):
      net: ti: icssg-prueth: Do not print physical memory addresses
      net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args
      net: stmmac: imx: Use syscon_regmap_lookup_by_phandle_args
      net: stmmac: sti: Use syscon_regmap_lookup_by_phandle_args
      net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args

 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c   | 10 +++-------
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c   |  9 ++-------
 drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c |  9 ++-------
 drivers/net/ethernet/ti/am65-cpsw-nuss.c          |  9 ++-------
 drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c  |  2 --
 5 files changed, 9 insertions(+), 30 deletions(-)
---
base-commit: 8a7b73388d7ab9aed82d5b81f943cc512ee54e9e
change-id: 20250112-syscon-phandle-args-net-386d05e2cd7e

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


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

* [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses
  2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
@ 2025-01-12 13:32 ` Krzysztof Kozlowski
  2025-01-13  8:03   ` MD Danish Anwar
  2025-01-12 13:32 ` [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:32 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx,
	Krzysztof Kozlowski

Debugging messages should not reveal anything about memory addresses.
This also solves arm compile test warnings:

  drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c:1034:49: error:
    format specifies type 'unsigned long long' but the argument has type 'phys_addr_t' (aka 'unsigned int') [-Werror,-Wformat]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
index 3dc86397c367d2b195badcf1fcb5f1ef39ffabd6..64a19ff39562fa4a6ba6f7e9de903f689a3d5715 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
@@ -1031,8 +1031,6 @@ static int prueth_probe(struct platform_device *pdev)
 						   (unsigned long)prueth->msmcram.va);
 	prueth->msmcram.size = msmc_ram_size;
 	memset_io(prueth->msmcram.va, 0, msmc_ram_size);
-	dev_dbg(dev, "sram: pa %llx va %p size %zx\n", prueth->msmcram.pa,
-		prueth->msmcram.va, prueth->msmcram.size);
 
 	prueth->iep0 = icss_iep_get_idx(np, 0);
 	if (IS_ERR(prueth->iep0)) {

-- 
2.43.0


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

* [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args
  2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
  2025-01-12 13:32 ` [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses Krzysztof Kozlowski
@ 2025-01-12 13:32 ` Krzysztof Kozlowski
  2025-01-13  8:07   ` MD Danish Anwar
  2025-01-12 13:32 ` [PATCH net-next 3/5] net: stmmac: imx: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:32 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx,
	Krzysztof Kozlowski

Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 5465bf872734a3fb9e7e481d556eaec3cce30e0e..68f1136e3db725eba239b10f337786ac735030ca 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2559,20 +2559,15 @@ static int am65_cpsw_am654_get_efuse_macid(struct device_node *of_node,
 {
 	u32 mac_lo, mac_hi, offset;
 	struct regmap *syscon;
-	int ret;
 
-	syscon = syscon_regmap_lookup_by_phandle(of_node, "ti,syscon-efuse");
+	syscon = syscon_regmap_lookup_by_phandle_args(of_node, "ti,syscon-efuse",
+						      1, &offset);
 	if (IS_ERR(syscon)) {
 		if (PTR_ERR(syscon) == -ENODEV)
 			return 0;
 		return PTR_ERR(syscon);
 	}
 
-	ret = of_property_read_u32_index(of_node, "ti,syscon-efuse", 1,
-					 &offset);
-	if (ret)
-		return ret;
-
 	regmap_read(syscon, offset, &mac_lo);
 	regmap_read(syscon, offset + 4, &mac_hi);
 

-- 
2.43.0


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

* [PATCH net-next 3/5] net: stmmac: imx: Use syscon_regmap_lookup_by_phandle_args
  2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
  2025-01-12 13:32 ` [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses Krzysztof Kozlowski
  2025-01-12 13:32 ` [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
@ 2025-01-12 13:32 ` Krzysztof Kozlowski
  2025-01-12 13:32 ` [PATCH net-next 4/5] net: stmmac: sti: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:32 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx,
	Krzysztof Kozlowski

Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

There is also no real benefit in printing errors on missing syscon
argument, because this is done just too late: runtime check on
static/build-time data.  Dtschema and Devicetree bindings offer the
static/build-time check for this already.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index 4ac7a78f4b14b95169787538b56dad7f7fe162d3..20d3a202bb8d16743ba4f31fa8ebf19a246e8236 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -302,15 +302,11 @@ imx_dwmac_parse_dt(struct imx_priv_data *dwmac, struct device *dev)
 		 * is required by i.MX8MP, i.MX93.
 		 * is optinoal for i.MX8DXL.
 		 */
-		dwmac->intf_regmap = syscon_regmap_lookup_by_phandle(np, "intf_mode");
+		dwmac->intf_regmap =
+			syscon_regmap_lookup_by_phandle_args(np, "intf_mode", 1,
+							     &dwmac->intf_reg_off);
 		if (IS_ERR(dwmac->intf_regmap))
 			return PTR_ERR(dwmac->intf_regmap);
-
-		err = of_property_read_u32_index(np, "intf_mode", 1, &dwmac->intf_reg_off);
-		if (err) {
-			dev_err(dev, "Can't get intf mode reg offset (%d)\n", err);
-			return err;
-		}
 	}
 
 	return err;

-- 
2.43.0


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

* [PATCH net-next 4/5] net: stmmac: sti: Use syscon_regmap_lookup_by_phandle_args
  2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2025-01-12 13:32 ` [PATCH net-next 3/5] net: stmmac: imx: " Krzysztof Kozlowski
@ 2025-01-12 13:32 ` Krzysztof Kozlowski
  2025-01-12 13:32 ` [PATCH net-next 5/5] net: stmmac: stm32: " Krzysztof Kozlowski
  2025-01-15  2:10 ` [PATCH net-next 0/5] net: ethernet: Simplify few things patchwork-bot+netdevbpf
  5 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:32 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx,
	Krzysztof Kozlowski

Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

There is also no real benefit in printing errors on missing syscon
argument, because this is done just too late: runtime check on
static/build-time data.  Dtschema and Devicetree bindings offer the
static/build-time check for this already.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
index eabc4da9e1a985101643908d2efdb0b4acaa9d60..d30d34fa6ca52e32b10c312c96d462bd6df859d1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
@@ -199,16 +199,11 @@ static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
 	if (res)
 		dwmac->clk_sel_reg = res->start;
 
-	regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon");
+	regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon",
+						      1, &dwmac->ctrl_reg);
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
 
-	err = of_property_read_u32_index(np, "st,syscon", 1, &dwmac->ctrl_reg);
-	if (err) {
-		dev_err(dev, "Can't get sysconfig ctrl offset (%d)\n", err);
-		return err;
-	}
-
 	err = of_get_phy_mode(np, &dwmac->interface);
 	if (err && err != -ENODEV) {
 		dev_err(dev, "Can't get phy-mode\n");

-- 
2.43.0


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

* [PATCH net-next 5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args
  2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2025-01-12 13:32 ` [PATCH net-next 4/5] net: stmmac: sti: " Krzysztof Kozlowski
@ 2025-01-12 13:32 ` Krzysztof Kozlowski
  2025-01-13  8:05   ` Yanteng Si
  2025-01-15  2:10 ` [PATCH net-next 0/5] net: ethernet: Simplify few things patchwork-bot+netdevbpf
  5 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:32 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx,
	Krzysztof Kozlowski

Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

There is also no real benefit in printing errors on missing syscon
argument, because this is done just too late: runtime check on
static/build-time data.  Dtschema and Devicetree bindings offer the
static/build-time check for this already.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index 1e8bac665cc9bc95c3aa96e87a8e95d9c63ba8e1..1fcb74e9e3ffacdc7581b267febb55d015a83aed 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -419,16 +419,11 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
 	}
 
 	/* Get mode register */
-	dwmac->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon");
+	dwmac->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon",
+							     1, &dwmac->mode_reg);
 	if (IS_ERR(dwmac->regmap))
 		return PTR_ERR(dwmac->regmap);
 
-	err = of_property_read_u32_index(np, "st,syscon", 1, &dwmac->mode_reg);
-	if (err) {
-		dev_err(dev, "Can't get sysconfig mode offset (%d)\n", err);
-		return err;
-	}
-
 	if (dwmac->ops->is_mp2)
 		return 0;
 

-- 
2.43.0


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

* Re: [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses
  2025-01-12 13:32 ` [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses Krzysztof Kozlowski
@ 2025-01-13  8:03   ` MD Danish Anwar
  0 siblings, 0 replies; 15+ messages in thread
From: MD Danish Anwar @ 2025-01-13  8:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx



On 12/01/25 7:02 pm, Krzysztof Kozlowski wrote:
> Debugging messages should not reveal anything about memory addresses.
> This also solves arm compile test warnings:
> 
>   drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c:1034:49: error:
>     format specifies type 'unsigned long long' but the argument has type 'phys_addr_t' (aka 'unsigned int') [-Werror,-Wformat]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: MD Danish Anwar <danishanwar@ti.com>

-- 
Thanks and Regards,
Danish

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

* Re: [PATCH net-next 5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args
  2025-01-12 13:32 ` [PATCH net-next 5/5] net: stmmac: stm32: " Krzysztof Kozlowski
@ 2025-01-13  8:05   ` Yanteng Si
  2025-01-13 11:08     ` Krzysztof Kozlowski
  2025-01-13 17:01     ` Andrew Lunn
  0 siblings, 2 replies; 15+ messages in thread
From: Yanteng Si @ 2025-01-13  8:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski, MD Danish Anwar, Roger Quadros, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx

在 2025/1/12 21:32, Krzysztof Kozlowski 写道:
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument.  Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
> 
> There is also no real benefit in printing errors on missing syscon
> argument, because this is done just too late: runtime check on
> static/build-time data.  Dtschema and Devicetree bindings offer the
> static/build-time check for this already.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> index 1e8bac665cc9bc95c3aa96e87a8e95d9c63ba8e1..1fcb74e9e3ffacdc7581b267febb55d015a83aed 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> @@ -419,16 +419,11 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
>   	}
>   
>   	/* Get mode register */
> -	dwmac->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon");
> +	dwmac->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon",
> +							     1, &dwmac->mode_reg);
The network subsystem still requires that the length of
each line of code should not exceed 80 characters.
So, let's silence the warning:

WARNING: line length of 83 exceeds 80 columns
#33: FILE: drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c:307:
+							     &dwmac->intf_reg_off);


BTW, The other two stmmac patches also need to adjust
the code so that each line doesn't exceed 80 characters.

Thanks,
Yanteng

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

* Re: [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args
  2025-01-12 13:32 ` [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
@ 2025-01-13  8:07   ` MD Danish Anwar
  2025-01-13 11:04     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 15+ messages in thread
From: MD Danish Anwar @ 2025-01-13  8:07 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx



On 12/01/25 7:02 pm, Krzysztof Kozlowski wrote:
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument.  Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 

The patch only touches `drivers/net/ethernet/ti/am65-cpsw-nuss.c`
however the subject suggests the patch is related to "icssg-prueth".

I suppose the subject should be changed to "am65-cpsw-nuss" instead of
"icssg-prueth"

-- 
Thanks and Regards,
Danish

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

* Re: [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args
  2025-01-13  8:07   ` MD Danish Anwar
@ 2025-01-13 11:04     ` Krzysztof Kozlowski
  2025-01-15  2:06       ` Jakub Kicinski
  0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-13 11:04 UTC (permalink / raw)
  To: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx

On 13/01/2025 09:07, MD Danish Anwar wrote:
> 
> 
> On 12/01/25 7:02 pm, Krzysztof Kozlowski wrote:
>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>> argument.  Except simpler code this annotates within one line that given
>> phandle has arguments, so grepping for code would be easier.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++-------
>>  1 file changed, 2 insertions(+), 7 deletions(-)
>>
> 
> The patch only touches `drivers/net/ethernet/ti/am65-cpsw-nuss.c`
> however the subject suggests the patch is related to "icssg-prueth".
> 
> I suppose the subject should be changed to "am65-cpsw-nuss" instead of
> "icssg-prueth"

Indeed, copy paste.

Best regards,
Krzysztof

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

* Re: [PATCH net-next 5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args
  2025-01-13  8:05   ` Yanteng Si
@ 2025-01-13 11:08     ` Krzysztof Kozlowski
  2025-01-13 17:01     ` Andrew Lunn
  1 sibling, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-13 11:08 UTC (permalink / raw)
  To: Yanteng Si, MD Danish Anwar, Roger Quadros, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx

On 13/01/2025 09:05, Yanteng Si wrote:
>> -	dwmac->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon");
>> +	dwmac->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon",
>> +							     1, &dwmac->mode_reg);
> The network subsystem still requires that the length of
> each line of code should not exceed 80 characters.


Please read the coding style regarding this issue, before you nitpick
such things.

I see you send comments like:
WARNING: line length of 81 exceeds 80 columns

which is not really helpful. That's not the review aspect necessary to
point.

> So, let's silence the warning:
> 
> WARNING: line length of 83 exceeds 80 columns
> #33: FILE: drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c:307:
> +							     &dwmac->intf_reg_off);

Unless networking maintainers tell me otherwise, I find my code more
readable thus it follows the coding style.

Best regards,
Krzysztof

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

* Re: [PATCH net-next 5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args
  2025-01-13  8:05   ` Yanteng Si
  2025-01-13 11:08     ` Krzysztof Kozlowski
@ 2025-01-13 17:01     ` Andrew Lunn
  2025-01-14  1:58       ` Yanteng Si
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Lunn @ 2025-01-13 17:01 UTC (permalink / raw)
  To: Yanteng Si
  Cc: Krzysztof Kozlowski, MD Danish Anwar, Roger Quadros, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx

On Mon, Jan 13, 2025 at 04:05:13PM +0800, Yanteng Si wrote:
> 在 2025/1/12 21:32, Krzysztof Kozlowski 写道:
> > Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> > syscon_regmap_lookup_by_phandle() combined with getting the syscon
> > argument.  Except simpler code this annotates within one line that given
> > phandle has arguments, so grepping for code would be easier.
> > 
> > There is also no real benefit in printing errors on missing syscon
> > argument, because this is done just too late: runtime check on
> > static/build-time data.  Dtschema and Devicetree bindings offer the
> > static/build-time check for this already.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >   drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 9 ++-------
> >   1 file changed, 2 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> > index 1e8bac665cc9bc95c3aa96e87a8e95d9c63ba8e1..1fcb74e9e3ffacdc7581b267febb55d015a83aed 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> > @@ -419,16 +419,11 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
> >   	}
> >   	/* Get mode register */
> > -	dwmac->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon");
> > +	dwmac->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon",
> > +							     1, &dwmac->mode_reg);
> The network subsystem still requires that the length of
> each line of code should not exceed 80 characters.
> So, let's silence the warning:
> 
> WARNING: line length of 83 exceeds 80 columns
> #33: FILE: drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c:307:
> +							     &dwmac->intf_reg_off);

checkpatch should be considered a guide, not a strict conformance
tool. You often need to look at its output and consider does what it
suggest really make the code better? In this case, i would disagree
with checkpatch and allow this code.

If the code had all been on one long line, then i would suggest to
wrap it. But as it is, it keeps with the spirit of 80 characters, even
if it is technically not.

	Andrew

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

* Re: [PATCH net-next 5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args
  2025-01-13 17:01     ` Andrew Lunn
@ 2025-01-14  1:58       ` Yanteng Si
  0 siblings, 0 replies; 15+ messages in thread
From: Yanteng Si @ 2025-01-14  1:58 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Krzysztof Kozlowski, MD Danish Anwar, Roger Quadros, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	linux-arm-kernel, netdev, linux-kernel, linux-stm32, imx




在 2025/1/14 01:01, Andrew Lunn 写道:
> On Mon, Jan 13, 2025 at 04:05:13PM +0800, Yanteng Si wrote:
>> 在 2025/1/12 21:32, Krzysztof Kozlowski 写道:
>>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>>> argument.  Except simpler code this annotates within one line that given
>>> phandle has arguments, so grepping for code would be easier.
>>>
>>> There is also no real benefit in printing errors on missing syscon
>>> argument, because this is done just too late: runtime check on
>>> static/build-time data.  Dtschema and Devicetree bindings offer the
>>> static/build-time check for this already.
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> ---
>>>    drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 9 ++-------
>>>    1 file changed, 2 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
>>> index 1e8bac665cc9bc95c3aa96e87a8e95d9c63ba8e1..1fcb74e9e3ffacdc7581b267febb55d015a83aed 100644
>>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
>>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
>>> @@ -419,16 +419,11 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
>>>    	}
>>>    	/* Get mode register */
>>> -	dwmac->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon");
>>> +	dwmac->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon",
>>> +							     1, &dwmac->mode_reg);
>> The network subsystem still requires that the length of
>> each line of code should not exceed 80 characters.
>> So, let's silence the warning:
>>
>> WARNING: line length of 83 exceeds 80 columns
>> #33: FILE: drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c:307:
>> +							     &dwmac->intf_reg_off);
> checkpatch should be considered a guide, not a strict conformance
> tool. You often need to look at its output and consider does what it
> suggest really make the code better? In this case, i would disagree
> with checkpatch and allow this code.
>
> If the code had all been on one long line, then i would suggest to
> wrap it. But as it is, it keeps with the spirit of 80 characters, even
> if it is technically not.
Oh, I got it! Thanks for explaining. You cleared up my confusion.

I made those comments based on my past experience. Actually, I
hesitated for ages before hitting the send button. I couldn't
figure out a better way other than refactoring the function.
I guess I might have come across as a bit unreasonable. But
now I understand the reasoning behind the ‘80 - character’
thing. I'll be more confident when dealing with this kind
of situation in the future.


Thanks,
Yanteng

> 	Andrew


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

* Re: [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args
  2025-01-13 11:04     ` Krzysztof Kozlowski
@ 2025-01-15  2:06       ` Jakub Kicinski
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2025-01-15  2:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
	Eric Dumazet, Paolo Abeni, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel, netdev, linux-kernel,
	linux-stm32, imx

On Mon, 13 Jan 2025 12:04:35 +0100 Krzysztof Kozlowski wrote:
> > The patch only touches `drivers/net/ethernet/ti/am65-cpsw-nuss.c`
> > however the subject suggests the patch is related to "icssg-prueth".
> > 
> > I suppose the subject should be changed to "am65-cpsw-nuss" instead of
> > "icssg-prueth"  
> 
> Indeed, copy paste.

Will fix when applying.

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

* Re: [PATCH net-next 0/5] net: ethernet: Simplify few things
  2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2025-01-12 13:32 ` [PATCH net-next 5/5] net: stmmac: stm32: " Krzysztof Kozlowski
@ 2025-01-15  2:10 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 15+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-15  2:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: danishanwar, rogerq, andrew+netdev, davem, edumazet, kuba, pabeni,
	alexandre.torgue, joabreu, mcoquelin.stm32, shawnguo, s.hauer,
	kernel, festevam, linux-arm-kernel, netdev, linux-kernel,
	linux-stm32, imx

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sun, 12 Jan 2025 14:32:42 +0100 you wrote:
> Few code simplifications without functional impact.  Not tested on
> hardware.
> 
> Best regards,
> Krzysztof
> 
> 
> [...]

Here is the summary with links:
  - [net-next,1/5] net: ti: icssg-prueth: Do not print physical memory addresses
    https://git.kernel.org/netdev/net-next/c/136fff12a759
  - [net-next,2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args
    https://git.kernel.org/netdev/net-next/c/621c88a39276
  - [net-next,3/5] net: stmmac: imx: Use syscon_regmap_lookup_by_phandle_args
    https://git.kernel.org/netdev/net-next/c/1e38b398b671
  - [net-next,4/5] net: stmmac: sti: Use syscon_regmap_lookup_by_phandle_args
    https://git.kernel.org/netdev/net-next/c/92ef3e4b3a5b
  - [net-next,5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args
    https://git.kernel.org/netdev/net-next/c/6e9c6882f9ef

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-01-15  2:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-12 13:32 [PATCH net-next 0/5] net: ethernet: Simplify few things Krzysztof Kozlowski
2025-01-12 13:32 ` [PATCH net-next 1/5] net: ti: icssg-prueth: Do not print physical memory addresses Krzysztof Kozlowski
2025-01-13  8:03   ` MD Danish Anwar
2025-01-12 13:32 ` [PATCH net-next 2/5] net: ti: icssg-prueth: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
2025-01-13  8:07   ` MD Danish Anwar
2025-01-13 11:04     ` Krzysztof Kozlowski
2025-01-15  2:06       ` Jakub Kicinski
2025-01-12 13:32 ` [PATCH net-next 3/5] net: stmmac: imx: " Krzysztof Kozlowski
2025-01-12 13:32 ` [PATCH net-next 4/5] net: stmmac: sti: " Krzysztof Kozlowski
2025-01-12 13:32 ` [PATCH net-next 5/5] net: stmmac: stm32: " Krzysztof Kozlowski
2025-01-13  8:05   ` Yanteng Si
2025-01-13 11:08     ` Krzysztof Kozlowski
2025-01-13 17:01     ` Andrew Lunn
2025-01-14  1:58       ` Yanteng Si
2025-01-15  2:10 ` [PATCH net-next 0/5] net: ethernet: Simplify few things patchwork-bot+netdevbpf

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