tree:
https://android.googlesource.com/kernel/common android-4.19-stable
head: 2f78c8b03bd36a05fdc4d37212fa2d821a8f5249
commit: 3179a1a38d96f565a2229b9244285c6abf62b10a [14816/14908] ANDROID: GKI: clk: Add
support for voltage voting
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
drivers/clk/clk.c:4417:14: warning: Identical condition 'cn->clk==clk',
second condition is always false [identicalConditionAfterEarlyExit]
if (cn->clk == clk) {
^
drivers/clk/clk.c:4414:15: note: If condition 'cn->clk==clk' is true, the
function will return/exit
if (cn->clk == clk)
^
drivers/clk/clk.c:4417:14: note: Testing identical condition 'cn->clk==clk'
if (cn->clk == clk) {
^
drivers/clk/clk.c:511:6: warning: Condition 'best_parent' is always true
[knownConditionTrueFalse]
if (best_parent)
^
drivers/clk/clk.c:507:6: note: Assuming that condition '!best_parent' is not
redundant
if (!best_parent)
^
drivers/clk/clk.c:511:6: note: Condition 'best_parent' is always true
if (best_parent)
^
drivers/clk/clk.c:4418:7: warning: Redundant initialization for 'ret'. The
initialized value is overwritten before it is read. [redundantInitialization]
ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb);
^
drivers/clk/clk.c:4406:10: note: ret is initialized
int ret = -EINVAL;
^
drivers/clk/clk.c:4418:7: note: ret is overwritten
ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb);
^
drivers/clk/clk.c:306:19: warning: The scope of the variable 'ret' can be
reduced. [variableScope]
struct clk_core *ret;
^
drivers/clk/clk.c:1144:6: warning: The scope of the variable 'ret' can be
reduced. [variableScope]
int ret = 0;
^
drivers/clk/clk.c:1898:16: warning: The scope of the variable 'flags' can be
reduced. [variableScope]
unsigned long flags;
^
drivers/clk/clk.c:2339:6: warning: The scope of the variable 'ret' can be
reduced. [variableScope]
int ret;
^
drivers/clk/clk.c:4019:22: warning: The scope of the variable 'dev_node' can be
reduced. [variableScope]
struct device_node *dev_node;
^
drivers/clk/clk.c:4044:6: warning: The scope of the variable 'level' can be
reduced. [variableScope]
int level, corner;
^
drivers/clk/clk.c:852:35: warning: Checking if unsigned expression
'clk->exclusive_count' is less than zero. [unsignedLessThanZero]
if (WARN_ON(clk->exclusive_count <= 0))
^
> drivers/clk/clk.c:676:11: warning: Variable 'ignore' is
assigned a value that is never used. [unreadVariable]
ignore =
regulator_enable(r[i]);
^
drivers/clk/clk.c:991:10: warning: Variable 'ret' is assigned a value that is
never used. [unreadVariable]
int ret = 0;
^
drivers/clk/clk.c:1144:10: warning: Variable 'ret' is assigned a value that is
never used. [unreadVariable]
int ret = 0;
^
drivers/clk/clk.c:4736:14: warning: The scope of the variable 'clk' can be
reduced. [variableScope]
struct clk *clk;
^
drivers/clk/clk.c:4897:7: warning: The scope of the variable 'is_init_done' can
be reduced. [variableScope]
bool is_init_done;
^
vim +/ignore +676 drivers/clk/clk.c
618
619 /*
620 * Update voltage level given the current votes.
621 */
622 static int clk_update_vdd(struct clk_vdd_class *vdd_class)
623 {
624 int level, rc = 0, i, ignore;
625 struct regulator **r = vdd_class->regulator;
626 int *uv = vdd_class->vdd_uv;
627 int n_reg = vdd_class->num_regulators;
628 int cur_lvl = vdd_class->cur_level;
629 int max_lvl = vdd_class->num_levels - 1;
630 int cur_base = cur_lvl * n_reg;
631 int new_base;
632
633 /* aggregate votes */
634 for (level = max_lvl; level > 0; level--)
635 if (vdd_class->level_votes[level])
636 break;
637
638 if (level == cur_lvl)
639 return 0;
640
641 max_lvl = max_lvl * n_reg;
642 new_base = level * n_reg;
643
644 for (i = 0; i < vdd_class->num_regulators; i++) {
645 pr_debug("Set Voltage level Min %d, Max %d\n", uv[new_base + i],
646 uv[max_lvl + i]);
647 rc = regulator_set_voltage(r[i], uv[new_base + i], INT_MAX);
648 if (rc)
649 goto set_voltage_fail;
650
651 if (cur_lvl == 0 || cur_lvl == vdd_class->num_levels)
652 rc = regulator_enable(r[i]);
653 else if (level == 0)
654 rc = regulator_disable(r[i]);
655 if (rc)
656 goto enable_disable_fail;
657 }
658
659 if (vdd_class->set_vdd && !vdd_class->num_regulators)
660 rc = vdd_class->set_vdd(vdd_class, level);
661
662 if (!rc)
663 vdd_class->cur_level = level;
664
665 return rc;
666
667 enable_disable_fail:
668 regulator_set_voltage(r[i], uv[cur_base + i], INT_MAX);
669
670 set_voltage_fail:
671 for (i--; i >= 0; i--) {
672 regulator_set_voltage(r[i], uv[cur_base + i], INT_MAX);
673 if (cur_lvl == 0 || cur_lvl == vdd_class->num_levels)
674 regulator_disable(r[i]);
675 else if (level == 0)
676 ignore = regulator_enable(r[i]);
677 }
678
679 return rc;
680 }
681
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org