Skip to contentSkip to conversation

drivers: cpufreq: use kstrtoul instead of obsolete simple_strtoul issue fixed

PATCH RESEND In review [email protected] 2 participants 2 messages Apr 21, 2019 – Apr 22, 2019 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers: cpufreq: use kstrtoul instead of obsolete simple_strtoul issue fixed

From: Mohan Kumar <[email protected]>

Replace the obsolte simple_strtoul function with kstrtoul.

---
 drivers/cpufreq/elanfreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/cpufreq/elanfreq.c +2 -1
index 03419f064752..6d861c2364e2 100644
@@ -184,7 +184,8 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
  */
 static int __init elanfreq_setup(char *str)
 {
-	max_freq = simple_strtoul(str, &str, 0);
+	unsigned long int val = 0;
+	max_freq = kstrtoul(str, 0, &val);
 	pr_warn("You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
 	return 1;
 }
Signature · 1 line
2.17.1
maintainer
#1 lore raw

You mentioned RESEND in $subject, which is incorrect. This isn't a simple resend but you changed the code. You should have mentioned V2 in $subject and ...

Quoted 6 lines · On 21-04-19, 18:05, [email protected] wrote:

From: Mohan Kumar <[email protected]>

Replace the obsolte simple_strtoul function with kstrtoul.

---

Mentioned V1->V2 diff right here in the patch.

drivers/cpufreq/elanfreq.c static int elanfreq_cpu_init(struct cpufreq_policy *policy) · line 187

Quoted 13 lines
 drivers/cpufreq/elanfreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/cpufreq/elanfreq.c +1 -1
index 03419f064752..6d861c2364e2 100644
@@ -184,7 +184,8 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
  */
 static int __init elanfreq_setup(char *str)
 {
-	max_freq = simple_strtoul(str, &str, 0);
+	unsigned long int val = 0;

A blank line here would be nice.

drivers/cpufreq/elanfreq.c static int elanfreq_cpu_init(struct cpufreq_policy *policy) · line 188

Quoted 1 line
drivers/cpufreq/elanfreq.c +1 -0
+	max_freq = kstrtoul(str, 0, &val);

And this looks wrong. The value isn't returned by kstrtoul but an error message or 0.

Quoted 5 lines
drivers/cpufreq/elanfreq.c +0 -0
 	pr_warn("You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
 	return 1;
 }
Signature · 1 line
2.17.1
Signature · 1 line
viresh