All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: RB532: fix return value of __setup handler
@ 2022-03-12  4:20 Randy Dunlap
  2022-03-14 14:51 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2022-03-12  4:20 UTC (permalink / raw)
  To: netdev
  Cc: patches, Randy Dunlap, Thomas Bogendoerfer, linux-mips,
	David S. Miller, Jakub Kicinski, Phil Sutter, Florian Fainelli,
	Ralf Baechle, Daniel Walter

__setup() handlers should return 1 to obsolete_checksetup() in
init/main.c to indicate that the boot option has been handled.
A return of 0 causes the boot option/value to be listed as an Unknown
kernel parameter and added to init's (limited) argument or environment
strings. Also, error return codes don't mean anything to
obsolete_checksetup() -- only non-zero (usually 1) or zero.
So return 1 from setup_kmac().

Fixes: 9e21c7e40b7e ("MIPS: RB532: Replace parse_mac_addr() with mac_pton().")
Fixes: 73b4390fb234 ("[MIPS] Routerboard 532: Support for base system")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
From: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Phil Sutter <n0-1@freewrt.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Daniel Walter <dwalter@google.com>
---
 arch/mips/rb532/devices.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- linux-next-20220309.orig/arch/mips/rb532/devices.c
+++ linux-next-20220309/arch/mips/rb532/devices.c
@@ -301,11 +301,9 @@ static int __init plat_setup_devices(voi
 static int __init setup_kmac(char *s)
 {
 	printk(KERN_INFO "korina mac = %s\n", s);
-	if (!mac_pton(s, korina_dev0_data.mac)) {
+	if (!mac_pton(s, korina_dev0_data.mac))
 		printk(KERN_ERR "Invalid mac\n");
-		return -EINVAL;
-	}
-	return 0;
+	return 1;
 }
 
 __setup("kmac=", setup_kmac);

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

* Re: [PATCH] MIPS: RB532: fix return value of __setup handler
  2022-03-12  4:20 [PATCH] MIPS: RB532: fix return value of __setup handler Randy Dunlap
@ 2022-03-14 14:51 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2022-03-14 14:51 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: netdev, patches, linux-mips, David S. Miller, Jakub Kicinski,
	Phil Sutter, Florian Fainelli, Ralf Baechle, Daniel Walter

On Fri, Mar 11, 2022 at 08:20:26PM -0800, Randy Dunlap wrote:
> __setup() handlers should return 1 to obsolete_checksetup() in
> init/main.c to indicate that the boot option has been handled.
> A return of 0 causes the boot option/value to be listed as an Unknown
> kernel parameter and added to init's (limited) argument or environment
> strings. Also, error return codes don't mean anything to
> obsolete_checksetup() -- only non-zero (usually 1) or zero.
> So return 1 from setup_kmac().
> 
> Fixes: 9e21c7e40b7e ("MIPS: RB532: Replace parse_mac_addr() with mac_pton().")
> Fixes: 73b4390fb234 ("[MIPS] Routerboard 532: Support for base system")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> From: Igor Zhbanov <i.zhbanov@omprussia.ru>
> Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Phil Sutter <n0-1@freewrt.org>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Daniel Walter <dwalter@google.com>
> ---
>  arch/mips/rb532/devices.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2022-03-14 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12  4:20 [PATCH] MIPS: RB532: fix return value of __setup handler Randy Dunlap
2022-03-14 14:51 ` Thomas Bogendoerfer

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.