From: Liam Beguin <liambeguin@gmail.com>
To: Liam Beguin <liambeguin@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel test robot <lkp@intel.com>
Subject: [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible
Date: Sat, 19 Nov 2022 22:02:54 -0500 [thread overview]
Message-ID: <20221120030257.531153-2-liambeguin@gmail.com> (raw)
In-Reply-To: <20221120030257.531153-1-liambeguin@gmail.com>
Fix the following warning reported by the kernel test robot.
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/clk/clk-lmk04832.c:357:15: warning: Variable 'pll2_p' can be declared with const [constVariable]
unsigned int pll2_p[] = {8, 2, 2, 3, 4, 5, 6, 7};
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/all/202203312017.5YW13Jr4-lkp@intel.com/
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
drivers/clk/clk-lmk04832.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index f416f8bc2898..9d18fd23bea0 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -371,7 +371,7 @@ static unsigned long lmk04832_vco_recalc_rate(struct clk_hw *hw,
unsigned long prate)
{
struct lmk04832 *lmk = container_of(hw, struct lmk04832, vco);
- unsigned int pll2_p[] = {8, 2, 2, 3, 4, 5, 6, 7};
+ const unsigned int pll2_p[] = {8, 2, 2, 3, 4, 5, 6, 7};
unsigned int pll2_n, p, pll2_r;
unsigned int pll2_misc;
unsigned long vco_rate;
@@ -633,7 +633,7 @@ static int lmk04832_register_vco(struct lmk04832 *lmk)
static int lmk04832_clkout_set_ddly(struct lmk04832 *lmk, int id)
{
- int dclk_div_adj[] = {0, 0, -2, -2, 0, 3, -1, 0};
+ const int dclk_div_adj[] = {0, 0, -2, -2, 0, 3, -1, 0};
unsigned int sclkx_y_ddly = 10;
unsigned int dclkx_y_ddly;
unsigned int dclkx_y_div;
--
2.37.1.223.g6a475b71f8c4
next prev parent reply other threads:[~2022-11-20 3:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 3:02 [PATCH v1 0/4] clk: lmk04832: fix minor warnings and syntax issues Liam Beguin
2022-11-20 3:02 ` Liam Beguin [this message]
2022-12-09 1:19 ` [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible Stephen Boyd
2022-11-20 3:02 ` [PATCH v1 2/4] clk: lmk04832: drop unnecessary semicolons Liam Beguin
2022-12-09 1:19 ` Stephen Boyd
2022-11-20 3:02 ` [PATCH v1 3/4] clk: lmk04832: drop superfluous #include Liam Beguin
2022-12-09 1:19 ` Stephen Boyd
2022-11-20 3:02 ` [PATCH v1 4/4] clk: lmk04832: fix kernel-doc warnings Liam Beguin
2022-12-09 1:19 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221120030257.531153-2-liambeguin@gmail.com \
--to=liambeguin@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox