drivers/base/power/opp/core.c:595:5: error: redefinition of 'dev_pm_opp_set_rate'

From: kbuild test robot
Date: Sun Feb 12 2017 - 15:39:19 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: 6a0712f6f199e737aa5913d28ec4bd3a25de9660 PM / OPP: Add dev_pm_opp_set_rate()
date: 1 year ago
config: x86_64-randconfig-x008-201707 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 6a0712f6f199e737aa5913d28ec4bd3a25de9660
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

drivers/base/power/opp/core.c:125:15: error: redefinition of 'dev_pm_opp_get_voltage'
unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:69:29: note: previous definition of 'dev_pm_opp_get_voltage' was here
static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
^~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:157:15: error: redefinition of 'dev_pm_opp_get_freq'
unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
^~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:74:29: note: previous definition of 'dev_pm_opp_get_freq' was here
static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
^~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:192:6: error: redefinition of 'dev_pm_opp_is_turbo'
bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp)
^~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:79:20: note: previous definition of 'dev_pm_opp_is_turbo' was here
static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp)
^~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:216:15: error: redefinition of 'dev_pm_opp_get_max_clock_latency'
unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:89:29: note: previous definition of 'dev_pm_opp_get_max_clock_latency' was here
static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:242:15: error: redefinition of 'dev_pm_opp_get_max_volt_latency'
unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:94:29: note: previous definition of 'dev_pm_opp_get_max_volt_latency' was here
static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:303:15: error: redefinition of 'dev_pm_opp_get_max_transition_latency'
unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:99:29: note: previous definition of 'dev_pm_opp_get_max_transition_latency' was here
static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:323:20: error: redefinition of 'dev_pm_opp_get_suspend_opp'
struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:104:34: note: previous definition of 'dev_pm_opp_get_suspend_opp' was here
static inline struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:347:5: error: redefinition of 'dev_pm_opp_get_opp_count'
int dev_pm_opp_get_opp_count(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:84:19: note: previous definition of 'dev_pm_opp_get_opp_count' was here
static inline int dev_pm_opp_get_opp_count(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:400:20: error: redefinition of 'dev_pm_opp_find_freq_exact'
struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:109:34: note: previous definition of 'dev_pm_opp_find_freq_exact' was here
static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:449:20: error: redefinition of 'dev_pm_opp_find_freq_ceil'
struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:121:34: note: previous definition of 'dev_pm_opp_find_freq_ceil' was here
static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:499:20: error: redefinition of 'dev_pm_opp_find_freq_floor'
struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:115:34: note: previous definition of 'dev_pm_opp_find_freq_floor' was here
static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/base/power/opp/core.c:595:5: error: redefinition of 'dev_pm_opp_set_rate'
int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
^~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:176:19: note: previous definition of 'dev_pm_opp_set_rate' was here
static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
^~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:920:6: error: redefinition of 'dev_pm_opp_remove'
void dev_pm_opp_remove(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:133:20: note: previous definition of 'dev_pm_opp_remove' was here
static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1200:5: error: redefinition of 'dev_pm_opp_set_supported_hw'
int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:153:19: note: previous definition of 'dev_pm_opp_set_supported_hw' was here
static inline int dev_pm_opp_set_supported_hw(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1260:6: error: redefinition of 'dev_pm_opp_put_supported_hw'
void dev_pm_opp_put_supported_hw(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:160:20: note: previous definition of 'dev_pm_opp_put_supported_hw' was here
static inline void dev_pm_opp_put_supported_hw(struct device *dev) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1311:5: error: redefinition of 'dev_pm_opp_set_prop_name'
int dev_pm_opp_set_prop_name(struct device *dev, const char *name)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:162:19: note: previous definition of 'dev_pm_opp_set_prop_name' was here
static inline int dev_pm_opp_set_prop_name(struct device *dev, const char *name)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1368:6: error: redefinition of 'dev_pm_opp_put_prop_name'
void dev_pm_opp_put_prop_name(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:167:20: note: previous definition of 'dev_pm_opp_put_prop_name' was here
static inline void dev_pm_opp_put_prop_name(struct device *dev) {}
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1417:5: error: redefinition of 'dev_pm_opp_set_regulator'
int dev_pm_opp_set_regulator(struct device *dev, const char *name)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:169:19: note: previous definition of 'dev_pm_opp_set_regulator' was here
static inline int dev_pm_opp_set_regulator(struct device *dev, const char *name)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1476:6: error: redefinition of 'dev_pm_opp_put_regulator'
void dev_pm_opp_put_regulator(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:174:20: note: previous definition of 'dev_pm_opp_put_regulator' was here
static inline void dev_pm_opp_put_regulator(struct device *dev) {}
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1669:5: error: redefinition of 'dev_pm_opp_add'
int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
^~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:127:19: note: previous definition of 'dev_pm_opp_add' was here
static inline int dev_pm_opp_add(struct device *dev, unsigned long freq,
^~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1776:5: error: redefinition of 'dev_pm_opp_enable'
int dev_pm_opp_enable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:137:19: note: previous definition of 'dev_pm_opp_enable' was here
static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1802:5: error: redefinition of 'dev_pm_opp_disable'
int dev_pm_opp_disable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:142:19: note: previous definition of 'dev_pm_opp_disable' was here
static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1822:28: error: redefinition of 'dev_pm_opp_get_notifier'
struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:
include/linux/pm_opp.h:147:42: note: previous definition of 'dev_pm_opp_get_notifier' was here
static inline struct srcu_notifier_head *dev_pm_opp_get_notifier(
^~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1847:6: error: redefinition of 'dev_pm_opp_of_remove_table'
void dev_pm_opp_of_remove_table(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:25:

vim +/dev_pm_opp_set_rate +595 drivers/base/power/opp/core.c

493 * Locking: This function must be called under rcu_read_lock(). opp is a rcu
494 * protected pointer. The reason for the same is that the opp pointer which is
495 * returned will remain valid for use with opp_get_{voltage, freq} only while
496 * under the locked area. The pointer returned must be used prior to unlocking
497 * with rcu_read_unlock() to maintain the integrity of the pointer.
498 */
> 499 struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
500 unsigned long *freq)
501 {
502 struct device_opp *dev_opp;
503 struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);
504
505 opp_rcu_lockdep_assert();
506
507 if (!dev || !freq) {
508 dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq);
509 return ERR_PTR(-EINVAL);
510 }
511
512 dev_opp = _find_device_opp(dev);
513 if (IS_ERR(dev_opp))
514 return ERR_CAST(dev_opp);
515
516 list_for_each_entry_rcu(temp_opp, &dev_opp->opp_list, node) {
517 if (temp_opp->available) {
518 /* go to the next node, before choosing prev */
519 if (temp_opp->rate > *freq)
520 break;
521 else
522 opp = temp_opp;
523 }
524 }
525 if (!IS_ERR(opp))
526 *freq = opp->rate;
527
528 return opp;
529 }
530 EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor);
531
532 /*
533 * The caller needs to ensure that device_opp (and hence the clk) isn't freed,
534 * while clk returned here is used.
535 */
536 static struct clk *_get_opp_clk(struct device *dev)
537 {
538 struct device_opp *dev_opp;
539 struct clk *clk;
540
541 rcu_read_lock();
542
543 dev_opp = _find_device_opp(dev);
544 if (IS_ERR(dev_opp)) {
545 dev_err(dev, "%s: device opp doesn't exist\n", __func__);
546 clk = ERR_CAST(dev_opp);
547 goto unlock;
548 }
549
550 clk = dev_opp->clk;
551 if (IS_ERR(clk))
552 dev_err(dev, "%s: No clock available for the device\n",
553 __func__);
554
555 unlock:
556 rcu_read_unlock();
557 return clk;
558 }
559
560 static int _set_opp_voltage(struct device *dev, struct regulator *reg,
561 unsigned long u_volt, unsigned long u_volt_min,
562 unsigned long u_volt_max)
563 {
564 int ret;
565
566 /* Regulator not available for device */
567 if (IS_ERR(reg)) {
568 dev_dbg(dev, "%s: regulator not available: %ld\n", __func__,
569 PTR_ERR(reg));
570 return 0;
571 }
572
573 dev_dbg(dev, "%s: voltages (mV): %lu %lu %lu\n", __func__, u_volt_min,
574 u_volt, u_volt_max);
575
576 ret = regulator_set_voltage_triplet(reg, u_volt_min, u_volt,
577 u_volt_max);
578 if (ret)
579 dev_err(dev, "%s: failed to set voltage (%lu %lu %lu mV): %d\n",
580 __func__, u_volt_min, u_volt, u_volt_max, ret);
581
582 return ret;
583 }
584
585 /**
586 * dev_pm_opp_set_rate() - Configure new OPP based on frequency
587 * @dev: device for which we do this operation
588 * @target_freq: frequency to achieve
589 *
590 * This configures the power-supplies and clock source to the levels specified
591 * by the OPP corresponding to the target_freq.
592 *
593 * Locking: This function takes rcu_read_lock().
594 */
> 595 int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
596 {
597 struct device_opp *dev_opp;
598 struct dev_pm_opp *old_opp, *opp;

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

Attachment: .config.gz
Description: application/gzip