drivers/base/power/opp/cpu.c:48:5: error: redefinition of 'dev_pm_opp_init_cpufreq_table'

From: kbuild test robot
Date: Sun Jan 22 2017 - 15:21:13 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c497f8d17246720afe680ea1a8fa6e48e75af852
commit: 33692dc381f9b89ddfc408631bf670ac2fd08ffc PM / OPP: Move opp core to its own directory
date: 1 year, 4 months ago
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 33692dc381f9b89ddfc408631bf670ac2fd08ffc
# save the attached .config to linux build tree
make.cross ARCH=powerpc

All errors (new ones prefixed by >>):

>> drivers/base/power/opp/cpu.c:48:5: error: redefinition of 'dev_pm_opp_init_cpufreq_table'
int dev_pm_opp_init_cpufreq_table(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/cpu.c:13:0:
include/linux/cpufreq.h:514:19: note: previous definition of 'dev_pm_opp_init_cpufreq_table' was here
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/base/power/opp/cpu.c:106:6: error: redefinition of 'dev_pm_opp_free_cpufreq_table'
void dev_pm_opp_free_cpufreq_table(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/cpu.c:13:0:
include/linux/cpufreq.h:521:20: note: previous definition of 'dev_pm_opp_free_cpufreq_table' was here
static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/dev_pm_opp_init_cpufreq_table +48 drivers/base/power/opp/cpu.c

a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 42 *
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 43 * Locking: The internal device_opp and opp structures are RCU protected.
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 44 * Since we just use the regular accessor functions to access the internal data
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 45 * structures, we use RCU read lock inside this function. As a result, users of
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 46 * this function DONOT need to use explicit locks for invoking.
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 47 */
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 @48 int dev_pm_opp_init_cpufreq_table(struct device *dev,
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 49 struct cpufreq_frequency_table **table)
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 50 {
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 51 struct dev_pm_opp *opp;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 52 struct cpufreq_frequency_table *freq_table = NULL;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 53 int i, max_opps, ret = 0;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 54 unsigned long rate;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 55
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 56 rcu_read_lock();
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 57
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 58 max_opps = dev_pm_opp_get_opp_count(dev);
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 59 if (max_opps <= 0) {
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 60 ret = max_opps ? max_opps : -ENODATA;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 61 goto out;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 62 }
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 63
d3599920 drivers/cpufreq/cpufreq_opp.c Anand Moon 2014-09-05 64 freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_ATOMIC);
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 65 if (!freq_table) {
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 66 ret = -ENOMEM;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 67 goto out;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 68 }
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 69
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 70 for (i = 0, rate = 0; i < max_opps; i++, rate++) {
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 71 /* find next rate */
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 72 opp = dev_pm_opp_find_freq_ceil(dev, &rate);
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 73 if (IS_ERR(opp)) {
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 74 ret = PTR_ERR(opp);
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 75 goto out;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 76 }
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 77 freq_table[i].driver_data = i;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 78 freq_table[i].frequency = rate / 1000;
79eea44a drivers/cpufreq/cpufreq_opp.c Bartlomiej Zolnierkiewicz 2015-07-29 79
79eea44a drivers/cpufreq/cpufreq_opp.c Bartlomiej Zolnierkiewicz 2015-07-29 80 /* Is Boost/turbo opp ? */
79eea44a drivers/cpufreq/cpufreq_opp.c Bartlomiej Zolnierkiewicz 2015-07-29 81 if (dev_pm_opp_is_turbo(opp))
79eea44a drivers/cpufreq/cpufreq_opp.c Bartlomiej Zolnierkiewicz 2015-07-29 82 freq_table[i].flags = CPUFREQ_BOOST_FREQ;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 83 }
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 84
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 85 freq_table[i].driver_data = i;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 86 freq_table[i].frequency = CPUFREQ_TABLE_END;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 87
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 88 *table = &freq_table[0];
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 89
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 90 out:
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 91 rcu_read_unlock();
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 92 if (ret)
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 93 kfree(freq_table);
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 94
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 95 return ret;
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 96 }
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 97 EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 98
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 99 /**
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 100 * dev_pm_opp_free_cpufreq_table() - free the cpufreq table
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 101 * @dev: device for which we do this operation
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 102 * @table: table to free
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 103 *
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 104 * Free up the table allocated by dev_pm_opp_init_cpufreq_table
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 105 */
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 @106 void dev_pm_opp_free_cpufreq_table(struct device *dev,
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 107 struct cpufreq_frequency_table **table)
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 108 {
a0dd7b79 drivers/cpufreq/cpufreq_opp.c Nishanth Menon 2014-05-05 109 if (!table)

:::::: The code at line 48 was first introduced by commit
:::::: a0dd7b79657bd6644b914d16ce7f23468c44a7b4 PM / OPP: Move cpufreq specific OPP functions out of generic OPP library

:::::: TO: Nishanth Menon <nm@xxxxxx>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip