public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm: orion5x: use string choices helper
@ 2025-06-17  0:07 Kuninori Morimoto
  2025-06-17  1:28 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Kuninori Morimoto @ 2025-06-17  0:07 UTC (permalink / raw)
  To: Alexander Clouter, Andrew Lunn, Gregory Clement, Russell King,
	Sebastian Hesselbarth
  Cc: Andy Shevchenko, Kees Cook, linux-arm-kernel

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-orion5x/ts78xx-setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index af810e7ccd79..c250703e696d 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -460,7 +460,7 @@ static ssize_t ts78xx_fpga_show(struct kobject *kobj,
 	if (ts78xx_fpga.state < 0)
 		return sprintf(buf, "borked\n");
 
-	return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline");
+	return sprintf(buf, "%sline\n", str_on_off(ts78xx_fpga.state));
 }
 
 static ssize_t ts78xx_fpga_store(struct kobject *kobj,
-- 
2.43.0



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

* Re: [PATCH] arm: orion5x: use string choices helper
  2025-06-17  0:07 [PATCH] arm: orion5x: use string choices helper Kuninori Morimoto
@ 2025-06-17  1:28 ` Andrew Lunn
  2025-06-17  1:33   ` Kuninori Morimoto
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2025-06-17  1:28 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Alexander Clouter, Gregory Clement, Russell King,
	Sebastian Hesselbarth, Andy Shevchenko, Kees Cook,
	linux-arm-kernel

On Tue, Jun 17, 2025 at 12:07:42AM +0000, Kuninori Morimoto wrote:
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  arch/arm/mach-orion5x/ts78xx-setup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
> index af810e7ccd79..c250703e696d 100644
> --- a/arch/arm/mach-orion5x/ts78xx-setup.c
> +++ b/arch/arm/mach-orion5x/ts78xx-setup.c
> @@ -460,7 +460,7 @@ static ssize_t ts78xx_fpga_show(struct kobject *kobj,
>  	if (ts78xx_fpga.state < 0)
>  		return sprintf(buf, "borked\n");
>  
> -	return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline");
> +	return sprintf(buf, "%sline\n", str_on_off(ts78xx_fpga.state));

static inline const char *str_on_off(bool v)
{
	return v ? "on" : "off";
}

That is an ABI change. Sorry, but NACK.

	Andrew


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

* Re: [PATCH] arm: orion5x: use string choices helper
  2025-06-17  1:28 ` Andrew Lunn
@ 2025-06-17  1:33   ` Kuninori Morimoto
  2025-06-17  2:06     ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Kuninori Morimoto @ 2025-06-17  1:33 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Alexander Clouter, Gregory Clement, Russell King,
	Sebastian Hesselbarth, Andy Shevchenko, Kees Cook,
	linux-arm-kernel


Hi Andrew

Thank you for your review

> > -	return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline");
> > +	return sprintf(buf, "%sline\n", str_on_off(ts78xx_fpga.state));
> 
> static inline const char *str_on_off(bool v)
> {
> 	return v ? "on" : "off";
> }
> 
> That is an ABI change. Sorry, but NACK.

It updates format too, I guess it keeps "online/offline" ?

	-	return sprintf(buf, "%s\n", ...
	+	return sprintf(buf, "%sline\n", ...
		                       ^^^^

Thank you for your help !!

Best regards
---
Kuninori Morimoto


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

* Re: [PATCH] arm: orion5x: use string choices helper
  2025-06-17  1:33   ` Kuninori Morimoto
@ 2025-06-17  2:06     ` Andrew Lunn
  2025-06-17  2:13       ` Kuninori Morimoto
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2025-06-17  2:06 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Alexander Clouter, Gregory Clement, Russell King,
	Sebastian Hesselbarth, Andy Shevchenko, Kees Cook,
	linux-arm-kernel

On Tue, Jun 17, 2025 at 01:33:38AM +0000, Kuninori Morimoto wrote:
> 
> Hi Andrew
> 
> Thank you for your review
> 
> > > -	return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline");
> > > +	return sprintf(buf, "%sline\n", str_on_off(ts78xx_fpga.state));
> > 
> > static inline const char *str_on_off(bool v)
> > {
> > 	return v ? "on" : "off";
> > }
> > 
> > That is an ABI change. Sorry, but NACK.
> 
> It updates format too, I guess it keeps "online/offline" ?
> 
> 	-	return sprintf(buf, "%s\n", ...
> 	+	return sprintf(buf, "%sline\n", ...
> 		                       ^^^^
> 
> Thank you for your help !!

Ah, missed that, but you should of also mentioned it in the commit
message....

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

    Andrew


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

* Re: [PATCH] arm: orion5x: use string choices helper
  2025-06-17  2:06     ` Andrew Lunn
@ 2025-06-17  2:13       ` Kuninori Morimoto
  0 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2025-06-17  2:13 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Alexander Clouter, Gregory Clement, Russell King,
	Sebastian Hesselbarth, Andy Shevchenko, Kees Cook,
	linux-arm-kernel


Hi Andrew

> > > That is an ABI change. Sorry, but NACK.
(snip)
> > It updates format too, I guess it keeps "online/offline" ?
(snip)
> Ah, missed that, but you should of also mentioned it in the commit
> message....

Yes, indeed.
I will post v2 patch which mention about it, and has your Reviewed-by

Thank you for your help !!

Best regards
---
Kuninori Morimoto


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

end of thread, other threads:[~2025-06-17  2:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17  0:07 [PATCH] arm: orion5x: use string choices helper Kuninori Morimoto
2025-06-17  1:28 ` Andrew Lunn
2025-06-17  1:33   ` Kuninori Morimoto
2025-06-17  2:06     ` Andrew Lunn
2025-06-17  2:13       ` Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox