All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND] net: hsr: Use full string description when opening HSR network device
@ 2024-03-26  8:56 Lukasz Majewski
  2024-03-26 12:41 ` Andrew Lunn
  2024-03-29 10:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Lukasz Majewski @ 2024-03-26  8:56 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Eric Dumazet, Vladimir Oltean, David S. Miller,
	Jakub Kicinski, Oleksij Rempel, Tristram.Ha,
	Sebastian Andrzej Siewior, Paolo Abeni, Ravi Gunasekaran,
	Simon Horman, Nikita Zhandarovich, Murali Karicheri,
	Ricardo B. Marliere, linux-kernel, Lukasz Majewski

Up till now only single character ('A' or 'B') was used to provide
information of HSR slave network device status.

As it is also possible and valid, that Interlink network device may
be supported as well, the description must be more verbose. As a result
the full string description is now used.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
Changes for v2:
- Use const char * instead of char * - to assure that pointed string is
  immutable (.rodata allocated).
---
 net/hsr/hsr_device.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index c98b5b71ad7c..e9d45133d641 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -132,30 +132,29 @@ static int hsr_dev_open(struct net_device *dev)
 {
 	struct hsr_priv *hsr;
 	struct hsr_port *port;
-	char designation;
+	const char *designation = NULL;
 
 	hsr = netdev_priv(dev);
-	designation = '\0';
 
 	hsr_for_each_port(hsr, port) {
 		if (port->type == HSR_PT_MASTER)
 			continue;
 		switch (port->type) {
 		case HSR_PT_SLAVE_A:
-			designation = 'A';
+			designation = "Slave A";
 			break;
 		case HSR_PT_SLAVE_B:
-			designation = 'B';
+			designation = "Slave B";
 			break;
 		default:
-			designation = '?';
+			designation = "Unknown";
 		}
 		if (!is_slave_up(port->dev))
-			netdev_warn(dev, "Slave %c (%s) is not up; please bring it up to get a fully working HSR network\n",
+			netdev_warn(dev, "%s (%s) is not up; please bring it up to get a fully working HSR network\n",
 				    designation, port->dev->name);
 	}
 
-	if (designation == '\0')
+	if (!designation)
 		netdev_warn(dev, "No slave devices configured\n");
 
 	return 0;
-- 
2.20.1


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

* Re: [PATCH v2 RESEND] net: hsr: Use full string description when opening HSR network device
  2024-03-26  8:56 [PATCH v2 RESEND] net: hsr: Use full string description when opening HSR network device Lukasz Majewski
@ 2024-03-26 12:41 ` Andrew Lunn
  2024-03-29 10:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2024-03-26 12:41 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: netdev, Eric Dumazet, Vladimir Oltean, David S. Miller,
	Jakub Kicinski, Oleksij Rempel, Tristram.Ha,
	Sebastian Andrzej Siewior, Paolo Abeni, Ravi Gunasekaran,
	Simon Horman, Nikita Zhandarovich, Murali Karicheri,
	Ricardo B. Marliere, linux-kernel

On Tue, Mar 26, 2024 at 09:56:49AM +0100, Lukasz Majewski wrote:
> Up till now only single character ('A' or 'B') was used to provide
> information of HSR slave network device status.
> 
> As it is also possible and valid, that Interlink network device may
> be supported as well, the description must be more verbose. As a result
> the full string description is now used.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH v2 RESEND] net: hsr: Use full string description when opening HSR network device
  2024-03-26  8:56 [PATCH v2 RESEND] net: hsr: Use full string description when opening HSR network device Lukasz Majewski
  2024-03-26 12:41 ` Andrew Lunn
@ 2024-03-29 10:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-29 10:50 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: netdev, andrew, edumazet, olteanv, davem, kuba, o.rempel,
	Tristram.Ha, bigeasy, pabeni, r-gunasekaran, horms,
	n.zhandarovich, m-karicheri2, ricardo, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 26 Mar 2024 09:56:49 +0100 you wrote:
> Up till now only single character ('A' or 'B') was used to provide
> information of HSR slave network device status.
> 
> As it is also possible and valid, that Interlink network device may
> be supported as well, the description must be more verbose. As a result
> the full string description is now used.
> 
> [...]

Here is the summary with links:
  - [v2,RESEND] net: hsr: Use full string description when opening HSR network device
    https://git.kernel.org/netdev/net/c/10e52ad5ced2

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] 3+ messages in thread

end of thread, other threads:[~2024-03-29 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26  8:56 [PATCH v2 RESEND] net: hsr: Use full string description when opening HSR network device Lukasz Majewski
2024-03-26 12:41 ` Andrew Lunn
2024-03-29 10:50 ` patchwork-bot+netdevbpf

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.