Skip to contentSkip to conversation

drivers: cpufreq: use kstrtoul instead of obsolete simple_strtoul

PATCH Superseded Mohan Kumar 2 participants 2 messages Apr 19, 2019 – Apr 21, 2019 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

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

Replace the obsolte simple_strtoul function with kstrtoul.

---
 drivers/cpufreq/elanfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/elanfreq.c +1 -1
index 03419f0..bed76da 100644
@@ -184,7 +184,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
  */
 static int __init elanfreq_setup(char *str)
 {
-	max_freq = simple_strtoul(str, &str, 0);
+	max_freq = kstrtoul(str, 0, (unsigned long *)&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.7.4
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi Mohan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v5.1-rc5 next-20190418]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mohan-Kumar/drivers-cpufreq-use-kstrtoul-instead-of-obsolete-simple_strtoul/20190421-044216
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-c0-04211526 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers//cpufreq/elanfreq.c: In function 'elanfreq_setup':

>> drivers//cpufreq/elanfreq.c:187:48: error: 'val' undeclared (first use in this function); did you mean 'vmap'?
     max_freq = kstrtoul(str, 0, (unsigned long *)&val);
                                                   ^~~
                                                   vmap

drivers//cpufreq/elanfreq.c:187:48: note: each undeclared identifier is reported only once for each function it appears in

vim +187 drivers//cpufreq/elanfreq.c

171
172
173 #ifndef MODULE
174 /**
175 * elanfreq_setup - elanfreq command line parameter parsing
176 *
177 * elanfreq command line parameter. Use:
178 * elanfreq=66000
179 * to set the maximum CPU frequency to 66 MHz. Note that in
180 * case you do not give this boot parameter, the maximum
181 * frequency will fall back to _current_ CPU frequency which
182 * might be lower. If you build this as a module, use the
183 * max_freq module parameter instead.
184 */
185 static int __init elanfreq_setup(char *str)
186 {

 > 187		max_freq = kstrtoul(str, 0, (unsigned long *)&val);

188 pr_warn("You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
189 return 1;
190 }
191 __setup("elanfreq=", elanfreq_setup);
192 #endif
193
194

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation