Re: [PATCH] cpufreq: reinitialize new policy min/max when writing scaling_(max|min)_freq

From: kbuild test robot
Date: Sun May 27 2018 - 02:16:01 EST


Hi Kevin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v4.17-rc6]
[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/Kevin-Wangtao/cpufreq-reinitialize-new-policy-min-max-when-writing-scaling_-max-min-_freq/20180527-132510
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-x079-201821 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

drivers/cpufreq/cpufreq.c: In function 'store_scaling_min_freq':
>> drivers/cpufreq/cpufreq.c:700:12: error: invalid type argument of '->' (have 'struct cpufreq_policy')
new_policy->min = policy->user_policy.min; \
^
drivers/cpufreq/cpufreq.c:715:1: note: in expansion of macro 'store_one'
store_one(scaling_min_freq, min);
^~~~~~~~~
drivers/cpufreq/cpufreq.c:701:12: error: invalid type argument of '->' (have 'struct cpufreq_policy')
new_policy->max = policy->user_policy.max; \
^
drivers/cpufreq/cpufreq.c:715:1: note: in expansion of macro 'store_one'
store_one(scaling_min_freq, min);
^~~~~~~~~
drivers/cpufreq/cpufreq.c: In function 'store_scaling_max_freq':
>> drivers/cpufreq/cpufreq.c:700:12: error: invalid type argument of '->' (have 'struct cpufreq_policy')
new_policy->min = policy->user_policy.min; \
^
drivers/cpufreq/cpufreq.c:716:1: note: in expansion of macro 'store_one'
store_one(scaling_max_freq, max);
^~~~~~~~~
drivers/cpufreq/cpufreq.c:701:12: error: invalid type argument of '->' (have 'struct cpufreq_policy')
new_policy->max = policy->user_policy.max; \
^
drivers/cpufreq/cpufreq.c:716:1: note: in expansion of macro 'store_one'
store_one(scaling_max_freq, max);
^~~~~~~~~

vim +700 drivers/cpufreq/cpufreq.c

685
686 static int cpufreq_set_policy(struct cpufreq_policy *policy,
687 struct cpufreq_policy *new_policy);
688
689 /**
690 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
691 */
692 #define store_one(file_name, object) \
693 static ssize_t store_##file_name \
694 (struct cpufreq_policy *policy, const char *buf, size_t count) \
695 { \
696 int ret, temp; \
697 struct cpufreq_policy new_policy; \
698 \
699 memcpy(&new_policy, policy, sizeof(*policy)); \
> 700 new_policy->min = policy->user_policy.min; \
701 new_policy->max = policy->user_policy.max; \
702 \
703 ret = sscanf(buf, "%u", &new_policy.object); \
704 if (ret != 1) \
705 return -EINVAL; \
706 \
707 temp = new_policy.object; \
708 ret = cpufreq_set_policy(policy, &new_policy); \
709 if (!ret) \
710 policy->user_policy.object = temp; \
711 \
712 return ret ? ret : count; \
713 }
714

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

Attachment: .config.gz
Description: application/gzip