summaryrefslogtreecommitdiffstats
path: root/drivers/staging/clocking-wizard
diff options
context:
space:
mode:
authorSoren Brinkmann <soren.brinkmann@xilinx.com>2015-01-05 09:21:29 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-17 16:06:20 -0800
commit19f15a3000a6ede8c3fcd2735225b894002a7cc1 (patch)
tree635f2d629508c90e9980c4d3c9b06570587447df /drivers/staging/clocking-wizard
parentb6461b53e723ec24d57bdd7c23ee6fee4472bee9 (diff)
downloadlinux-stable-19f15a3000a6ede8c3fcd2735225b894002a7cc1.tar.gz
linux-stable-19f15a3000a6ede8c3fcd2735225b894002a7cc1.tar.bz2
linux-stable-19f15a3000a6ede8c3fcd2735225b894002a7cc1.zip
staging: clocking-wizard: Handle invalid clk in notifier
Even though it should never happen, handle the case that the clock notifier is called with an unexpected clock handle. This avoids the compiler warning: drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c: In function 'clk_wzrd_clk_notifier': >> drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c:99:6: warning: 'max' may be used uninitialized in this function [-Wmaybe-uninitialized] if (ndata->new_rate > max) ^ Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/clocking-wizard')
-rw-r--r--drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 9a7b36937a59..5455bf3d5a91 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -91,8 +91,10 @@ static int clk_wzrd_clk_notifier(struct notifier_block *nb, unsigned long event,
if (ndata->clk == clk_wzrd->clk_in1)
max = clk_wzrd_max_freq[clk_wzrd->speed_grade - 1];
- if (ndata->clk == clk_wzrd->axi_clk)
+ else if (ndata->clk == clk_wzrd->axi_clk)
max = WZRD_ACLK_MAX_FREQ;
+ else
+ return NOTIFY_DONE; /* should never happen */
switch (event) {
case PRE_RATE_CHANGE: