All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
@ 2012-07-11  9:56 Shaohui Xie
  2012-07-11 11:24   ` Bhushan Bharat-R65777
  2012-07-11 12:57   ` Kumar Gala
  0 siblings, 2 replies; 5+ messages in thread
From: Shaohui Xie @ 2012-07-11  9:56 UTC (permalink / raw)
  To: linux-watchdog, linuxppc-dev; +Cc: Shaohui Xie

Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is
in setup_32.c, it cannot be used in 64-bit, so move it to a common place
setup-common.c, which will be shared by 32-bit and 64-bit.

Also, replace the simple_strtoul with kstrtol.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
changes for v2:
use setup-common.c instead of prom.c

 arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
 arch/powerpc/kernel/setup_32.c     |   24 ------------------------
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index afd4f05..bdc499c 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -720,6 +720,33 @@ static int powerpc_debugfs_init(void)
 arch_initcall(powerpc_debugfs_init);
 #endif
 
+#ifdef CONFIG_BOOKE_WDT
+extern u32 booke_wdt_enabled;
+extern u32 booke_wdt_period;
+
+/* Checks wdt=x and wdt_period=xx command-line option */
+notrace int __init early_parse_wdt(char *p)
+{
+	if (p && strncmp(p, "0", 1) != 0)
+		booke_wdt_enabled = 1;
+
+	return 0;
+}
+early_param("wdt", early_parse_wdt);
+
+int __init early_parse_wdt_period(char *p)
+{
+	unsigned long ret;
+	if (p) {
+		if (!kstrtol(p, 0, &ret))
+			booke_wdt_period = ret;
+	}
+
+	return 0;
+}
+early_param("wdt_period", early_parse_wdt_period);
+#endif	/* CONFIG_BOOKE_WDT */
+
 void ppc_printk_progress(char *s, unsigned short hex)
 {
 	pr_info("%s\n", s);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index ec8a53f..a8f54ec 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -149,30 +149,6 @@ notrace void __init machine_init(u64 dt_ptr)
 		ppc_md.progress("id mach(): done", 0x200);
 }
 
-#ifdef CONFIG_BOOKE_WDT
-extern u32 booke_wdt_enabled;
-extern u32 booke_wdt_period;
-
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-	if (p && strncmp(p, "0", 1) != 0)
-	       booke_wdt_enabled = 1;
-
-	return 0;
-}
-early_param("wdt", early_parse_wdt);
-
-int __init early_parse_wdt_period (char *p)
-{
-	if (p)
-		booke_wdt_period = simple_strtoul(p, NULL, 0);
-
-	return 0;
-}
-early_param("wdt_period", early_parse_wdt_period);
-#endif	/* CONFIG_BOOKE_WDT */
-
 /* Checks "l2cr=xxxx" command-line option */
 int __init ppc_setup_l2cr(char *str)
 {
-- 
1.6.4



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

* RE: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
  2012-07-11  9:56 [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c Shaohui Xie
@ 2012-07-11 11:24   ` Bhushan Bharat-R65777
  2012-07-11 12:57   ` Kumar Gala
  1 sibling, 0 replies; 5+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-07-11 11:24 UTC (permalink / raw)
  To: Xie Shaohui-B21989, linux-watchdog, linuxppc-dev; +Cc: Xie Shaohui-B21989

ACK:

> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+bharat.bhushan=freescale.com@lists.ozlabs.org] On Behalf Of Shaohui Xie
> Sent: Wednesday, July 11, 2012 3:26 PM
> To: linux-watchdog@vger.kernel.org; linuxppc-dev@lists.ozlabs.org
> Cc: Xie Shaohui-B21989
> Subject: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to
> setup-common.c
> 
> Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is in
> setup_32.c, it cannot be used in 64-bit, so move it to a common place setup-
> common.c, which will be shared by 32-bit and 64-bit.
> 
> Also, replace the simple_strtoul with kstrtol.
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> changes for v2:
> use setup-common.c instead of prom.c
> 
>  arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
>  arch/powerpc/kernel/setup_32.c     |   24 ------------------------
>  2 files changed, 27 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-
> common.c
> index afd4f05..bdc499c 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -720,6 +720,33 @@ static int powerpc_debugfs_init(void)
> arch_initcall(powerpc_debugfs_init);
>  #endif
> 
> +#ifdef CONFIG_BOOKE_WDT
> +extern u32 booke_wdt_enabled;
> +extern u32 booke_wdt_period;
> +
> +/* Checks wdt=x and wdt_period=xx command-line option */ notrace int
> +__init early_parse_wdt(char *p) {
> +	if (p && strncmp(p, "0", 1) != 0)
> +		booke_wdt_enabled = 1;
> +
> +	return 0;
> +}
> +early_param("wdt", early_parse_wdt);
> +
> +int __init early_parse_wdt_period(char *p) {
> +	unsigned long ret;
> +	if (p) {
> +		if (!kstrtol(p, 0, &ret))
> +			booke_wdt_period = ret;
> +	}
> +
> +	return 0;
> +}
> +early_param("wdt_period", early_parse_wdt_period);
> +#endif	/* CONFIG_BOOKE_WDT */
> +
>  void ppc_printk_progress(char *s, unsigned short hex)  {
>  	pr_info("%s\n", s);
> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
> index ec8a53f..a8f54ec 100644
> --- a/arch/powerpc/kernel/setup_32.c
> +++ b/arch/powerpc/kernel/setup_32.c
> @@ -149,30 +149,6 @@ notrace void __init machine_init(u64 dt_ptr)
>  		ppc_md.progress("id mach(): done", 0x200);  }
> 
> -#ifdef CONFIG_BOOKE_WDT
> -extern u32 booke_wdt_enabled;
> -extern u32 booke_wdt_period;
> -
> -/* Checks wdt=x and wdt_period=xx command-line option */ -notrace int __init
> early_parse_wdt(char *p) -{
> -	if (p && strncmp(p, "0", 1) != 0)
> -	       booke_wdt_enabled = 1;
> -
> -	return 0;
> -}
> -early_param("wdt", early_parse_wdt);
> -
> -int __init early_parse_wdt_period (char *p) -{
> -	if (p)
> -		booke_wdt_period = simple_strtoul(p, NULL, 0);
> -
> -	return 0;
> -}
> -early_param("wdt_period", early_parse_wdt_period);
> -#endif	/* CONFIG_BOOKE_WDT */
> -
>  /* Checks "l2cr=xxxx" command-line option */  int __init ppc_setup_l2cr(char
> *str)  {
> --
> 1.6.4
> 
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev


--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
@ 2012-07-11 11:24   ` Bhushan Bharat-R65777
  0 siblings, 0 replies; 5+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-07-11 11:24 UTC (permalink / raw)
  To: Xie Shaohui-B21989, linux-watchdog, linuxppc-dev; +Cc: Xie Shaohui-B21989

ACK:

> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+bharat.bhushan=3Dfreescale.com@lists.ozlabs.org] On Behalf Of Sha=
ohui Xie
> Sent: Wednesday, July 11, 2012 3:26 PM
> To: linux-watchdog@vger.kernel.org; linuxppc-dev@lists.ozlabs.org
> Cc: Xie Shaohui-B21989
> Subject: [PATCH][v2] powerpc/watchdog: move booke watchdog param related =
code to
> setup-common.c
>=20
> Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is in
> setup_32.c, it cannot be used in 64-bit, so move it to a common place set=
up-
> common.c, which will be shared by 32-bit and 64-bit.
>=20
> Also, replace the simple_strtoul with kstrtol.
>=20
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> changes for v2:
> use setup-common.c instead of prom.c
>=20
>  arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
>  arch/powerpc/kernel/setup_32.c     |   24 ------------------------
>  2 files changed, 27 insertions(+), 24 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/set=
up-
> common.c
> index afd4f05..bdc499c 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -720,6 +720,33 @@ static int powerpc_debugfs_init(void)
> arch_initcall(powerpc_debugfs_init);
>  #endif
>=20
> +#ifdef CONFIG_BOOKE_WDT
> +extern u32 booke_wdt_enabled;
> +extern u32 booke_wdt_period;
> +
> +/* Checks wdt=3Dx and wdt_period=3Dxx command-line option */ notrace int
> +__init early_parse_wdt(char *p) {
> +	if (p && strncmp(p, "0", 1) !=3D 0)
> +		booke_wdt_enabled =3D 1;
> +
> +	return 0;
> +}
> +early_param("wdt", early_parse_wdt);
> +
> +int __init early_parse_wdt_period(char *p) {
> +	unsigned long ret;
> +	if (p) {
> +		if (!kstrtol(p, 0, &ret))
> +			booke_wdt_period =3D ret;
> +	}
> +
> +	return 0;
> +}
> +early_param("wdt_period", early_parse_wdt_period);
> +#endif	/* CONFIG_BOOKE_WDT */
> +
>  void ppc_printk_progress(char *s, unsigned short hex)  {
>  	pr_info("%s\n", s);
> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_3=
2.c
> index ec8a53f..a8f54ec 100644
> --- a/arch/powerpc/kernel/setup_32.c
> +++ b/arch/powerpc/kernel/setup_32.c
> @@ -149,30 +149,6 @@ notrace void __init machine_init(u64 dt_ptr)
>  		ppc_md.progress("id mach(): done", 0x200);  }
>=20
> -#ifdef CONFIG_BOOKE_WDT
> -extern u32 booke_wdt_enabled;
> -extern u32 booke_wdt_period;
> -
> -/* Checks wdt=3Dx and wdt_period=3Dxx command-line option */ -notrace in=
t __init
> early_parse_wdt(char *p) -{
> -	if (p && strncmp(p, "0", 1) !=3D 0)
> -	       booke_wdt_enabled =3D 1;
> -
> -	return 0;
> -}
> -early_param("wdt", early_parse_wdt);
> -
> -int __init early_parse_wdt_period (char *p) -{
> -	if (p)
> -		booke_wdt_period =3D simple_strtoul(p, NULL, 0);
> -
> -	return 0;
> -}
> -early_param("wdt_period", early_parse_wdt_period);
> -#endif	/* CONFIG_BOOKE_WDT */
> -
>  /* Checks "l2cr=3Dxxxx" command-line option */  int __init ppc_setup_l2c=
r(char
> *str)  {
> --
> 1.6.4
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

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

* Re: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
  2012-07-11  9:56 [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c Shaohui Xie
@ 2012-07-11 12:57   ` Kumar Gala
  2012-07-11 12:57   ` Kumar Gala
  1 sibling, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2012-07-11 12:57 UTC (permalink / raw)
  To: Shaohui Xie; +Cc: linux-watchdog, linuxppc-dev


On Jul 11, 2012, at 4:56 AM, Shaohui Xie wrote:

> Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is
> in setup_32.c, it cannot be used in 64-bit, so move it to a common place
> setup-common.c, which will be shared by 32-bit and 64-bit.
> 
> Also, replace the simple_strtoul with kstrtol.
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> changes for v2:
> use setup-common.c instead of prom.c
> 
> arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
> arch/powerpc/kernel/setup_32.c     |   24 ------------------------
> 2 files changed, 27 insertions(+), 24 deletions(-)

applied to next

- k

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

* Re: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
@ 2012-07-11 12:57   ` Kumar Gala
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2012-07-11 12:57 UTC (permalink / raw)
  To: Shaohui Xie; +Cc: linuxppc-dev, linux-watchdog


On Jul 11, 2012, at 4:56 AM, Shaohui Xie wrote:

> Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is
> in setup_32.c, it cannot be used in 64-bit, so move it to a common place
> setup-common.c, which will be shared by 32-bit and 64-bit.
> 
> Also, replace the simple_strtoul with kstrtol.
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> changes for v2:
> use setup-common.c instead of prom.c
> 
> arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
> arch/powerpc/kernel/setup_32.c     |   24 ------------------------
> 2 files changed, 27 insertions(+), 24 deletions(-)

applied to next

- k

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

end of thread, other threads:[~2012-07-11 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11  9:56 [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c Shaohui Xie
2012-07-11 11:24 ` Bhushan Bharat-R65777
2012-07-11 11:24   ` Bhushan Bharat-R65777
2012-07-11 12:57 ` Kumar Gala
2012-07-11 12:57   ` Kumar Gala

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.