linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/9] [arch/powerpc] replace obsolete strict_strto* calls
@ 2014-06-21 12:05 Daniel Walter
  2014-06-24  2:32 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Walter @ 2014-06-21 12:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linux-kernel; +Cc: linuxppc-dev

Replace strict_strto calls with more appropriate kstrto calls

Signed-off-by: Daniel Walter <dwalter@google.com>
---
 arch/powerpc/kernel/setup_64.c            | 6 +++---
 arch/powerpc/kernel/vio.c                 | 2 +-
 arch/powerpc/platforms/pseries/dlpar.c    | 4 ++--
 arch/powerpc/platforms/pseries/mobility.c | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index ee082d7..5257166 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -149,13 +149,13 @@ static void check_smt_enabled(void)
 		else if (!strcmp(smt_enabled_cmdline, "off"))
 			smt_enabled_at_boot = 0;
 		else {
-			long smt;
+			int smt;
 			int rc;
 
-			rc = strict_strtol(smt_enabled_cmdline, 10, &smt);
+			rc = kstrtoint(smt_enabled_cmdline, 10, &smt);
 			if (!rc)
 				smt_enabled_at_boot =
-					min(threads_per_core, (int)smt);
+					min(threads_per_core, smt);
 		}
 	} else {
 		dn = of_find_node_by_path("/options");
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 904c661..5bfdab9 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -977,7 +977,7 @@ static ssize_t viodev_cmo_desired_set(struct device *dev,
 	size_t new_desired;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &new_desired);
+	ret = kstrtoul(buf, 10, &new_desired);
 	if (ret)
 		return ret;
 
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 022b38e..abc6892 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -399,10 +399,10 @@ out:
 static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
 {
 	struct device_node *dn, *parent;
-	unsigned long drc_index;
+	u32 drc_index;
 	int rc;
 
-	rc = strict_strtoul(buf, 0, &drc_index);
+	rc = kstrtou32(buf, 0, &drc_index);
 	if (rc)
 		return -EINVAL;
 
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index bde7eba..0694ac6 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -319,7 +319,7 @@ static ssize_t migrate_store(struct class *class, struct class_attribute *attr,
 	u64 streamid;
 	int rc;
 
-	rc = strict_strtoull(buf, 0, &streamid);
+	rc = kstrtou64(buf, 0, &streamid);
 	if (rc)
 		return rc;
 
-- 
2.0.0.526.g5318336

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

* Re: [PATCH 5/9] [arch/powerpc] replace obsolete strict_strto* calls
  2014-06-21 12:05 [PATCH 5/9] [arch/powerpc] replace obsolete strict_strto* calls Daniel Walter
@ 2014-06-24  2:32 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2014-06-24  2:32 UTC (permalink / raw)
  To: Daniel Walter; +Cc: linuxppc-dev, linux-kernel

On Sat, 2014-06-21 at 13:05 +0100, Daniel Walter wrote:
> Replace strict_strto calls with more appropriate kstrto calls
> 
> Signed-off-by: Daniel Walter <dwalter@google.com>
> ---

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
--

Should I put that in the powerpc tree ?

>  arch/powerpc/kernel/setup_64.c            | 6 +++---
>  arch/powerpc/kernel/vio.c                 | 2 +-
>  arch/powerpc/platforms/pseries/dlpar.c    | 4 ++--
>  arch/powerpc/platforms/pseries/mobility.c | 2 +-
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index ee082d7..5257166 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -149,13 +149,13 @@ static void check_smt_enabled(void)
>  		else if (!strcmp(smt_enabled_cmdline, "off"))
>  			smt_enabled_at_boot = 0;
>  		else {
> -			long smt;
> +			int smt;
>  			int rc;
>  
> -			rc = strict_strtol(smt_enabled_cmdline, 10, &smt);
> +			rc = kstrtoint(smt_enabled_cmdline, 10, &smt);
>  			if (!rc)
>  				smt_enabled_at_boot =
> -					min(threads_per_core, (int)smt);
> +					min(threads_per_core, smt);
>  		}
>  	} else {
>  		dn = of_find_node_by_path("/options");
> diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
> index 904c661..5bfdab9 100644
> --- a/arch/powerpc/kernel/vio.c
> +++ b/arch/powerpc/kernel/vio.c
> @@ -977,7 +977,7 @@ static ssize_t viodev_cmo_desired_set(struct device *dev,
>  	size_t new_desired;
>  	int ret;
>  
> -	ret = strict_strtoul(buf, 10, &new_desired);
> +	ret = kstrtoul(buf, 10, &new_desired);
>  	if (ret)
>  		return ret;
>  
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 022b38e..abc6892 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -399,10 +399,10 @@ out:
>  static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
>  {
>  	struct device_node *dn, *parent;
> -	unsigned long drc_index;
> +	u32 drc_index;
>  	int rc;
>  
> -	rc = strict_strtoul(buf, 0, &drc_index);
> +	rc = kstrtou32(buf, 0, &drc_index);
>  	if (rc)
>  		return -EINVAL;
>  
> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index bde7eba..0694ac6 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -319,7 +319,7 @@ static ssize_t migrate_store(struct class *class, struct class_attribute *attr,
>  	u64 streamid;
>  	int rc;
>  
> -	rc = strict_strtoull(buf, 0, &streamid);
> +	rc = kstrtou64(buf, 0, &streamid);
>  	if (rc)
>  		return rc;
>  

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

end of thread, other threads:[~2014-06-24  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-21 12:05 [PATCH 5/9] [arch/powerpc] replace obsolete strict_strto* calls Daniel Walter
2014-06-24  2:32 ` Benjamin Herrenschmidt

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