* [PATCH v1 0/4] clk: lmk04832: fix minor warnings and syntax issues
@ 2022-11-20 3:02 Liam Beguin
2022-11-20 3:02 ` [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible Liam Beguin
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Liam Beguin @ 2022-11-20 3:02 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel
This series addresses a few automated reports I missed since adding
initial support for the lmk04832.
There are no functional changes here.
Liam Beguin (4):
clk: lmk04832: declare variables as const when possible
clk: lmk04832: drop unnecessary semicolons
clk: lmk04832: drop superfluous #include
clk: lmk04832: fix kernel-doc warnings
drivers/clk/clk-lmk04832.c | 41 +++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 21 deletions(-)
base-commit: 77c51ba552a1c4f73228766e43ae37c4101b3758
--
2.37.1.223.g6a475b71f8c4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible
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
2022-12-09 1:19 ` Stephen Boyd
2022-11-20 3:02 ` [PATCH v1 2/4] clk: lmk04832: drop unnecessary semicolons Liam Beguin
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Liam Beguin @ 2022-11-20 3:02 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, kernel test robot
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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v1 2/4] clk: lmk04832: drop unnecessary semicolons
2022-11-20 3:02 [PATCH v1 0/4] clk: lmk04832: fix minor warnings and syntax issues Liam Beguin
2022-11-20 3:02 ` [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible Liam Beguin
@ 2022-11-20 3:02 ` 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-11-20 3:02 ` [PATCH v1 4/4] clk: lmk04832: fix kernel-doc warnings Liam Beguin
3 siblings, 1 reply; 9+ messages in thread
From: Liam Beguin @ 2022-11-20 3:02 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel
Semicolons on the closing brace of a function definition are
unnecessary, remove them.
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
drivers/clk/clk-lmk04832.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index 9d18fd23bea0..3a5961fe604d 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -282,7 +282,7 @@ static bool lmk04832_regmap_rd_regs(struct device *dev, unsigned int reg)
default:
return false;
};
-};
+}
static bool lmk04832_regmap_wr_regs(struct device *dev, unsigned int reg)
{
@@ -305,7 +305,7 @@ static bool lmk04832_regmap_wr_regs(struct device *dev, unsigned int reg)
default:
return false;
};
-};
+}
static const struct regmap_config regmap_config = {
.name = "lmk04832",
@@ -403,7 +403,7 @@ static unsigned long lmk04832_vco_recalc_rate(struct clk_hw *hw,
pll2_misc)) * pll2_n * pll2_p[p] / pll2_r;
return vco_rate;
-};
+}
/**
* lmk04832_check_vco_ranges - Check requested VCO frequency against VCO ranges
@@ -509,7 +509,7 @@ static long lmk04832_vco_round_rate(struct clk_hw *hw, unsigned long rate,
return -EINVAL;
return vco_rate;
-};
+}
static int lmk04832_vco_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate)
@@ -568,7 +568,7 @@ static int lmk04832_vco_set_rate(struct clk_hw *hw, unsigned long rate,
return regmap_write(lmk->regmap, LMK04832_REG_PLL2_N_2,
FIELD_GET(0x0000ff, n));
-};
+}
static const struct clk_ops lmk04832_vco_ops = {
.is_enabled = lmk04832_vco_is_enabled,
@@ -1063,7 +1063,7 @@ static unsigned long lmk04832_dclk_recalc_rate(struct clk_hw *hw,
rate = DIV_ROUND_CLOSEST(prate, dclk_div);
return rate;
-};
+}
static long lmk04832_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
@@ -1085,7 +1085,7 @@ static long lmk04832_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
return -EINVAL;
return dclk_rate;
-};
+}
static int lmk04832_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate)
@@ -1147,7 +1147,7 @@ static int lmk04832_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
dev_err(lmk->dev, "SYNC sequence failed\n");
return ret;
-};
+}
static const struct clk_ops lmk04832_dclk_ops = {
.is_enabled = lmk04832_dclk_is_enabled,
@@ -1551,6 +1551,7 @@ static void lmk04832_remove(struct spi_device *spi)
clk_disable_unprepare(lmk->oscin);
of_clk_del_provider(spi->dev.of_node);
}
+
static const struct spi_device_id lmk04832_id[] = {
{ "lmk04832", LMK04832 },
{}
--
2.37.1.223.g6a475b71f8c4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v1 3/4] clk: lmk04832: drop superfluous #include
2022-11-20 3:02 [PATCH v1 0/4] clk: lmk04832: fix minor warnings and syntax issues Liam Beguin
2022-11-20 3:02 ` [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible Liam Beguin
2022-11-20 3:02 ` [PATCH v1 2/4] clk: lmk04832: drop unnecessary semicolons Liam Beguin
@ 2022-11-20 3:02 ` 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
3 siblings, 1 reply; 9+ messages in thread
From: Liam Beguin @ 2022-11-20 3:02 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, kernel test robot
iwyu warnings: (new ones prefixed by >>)
>> drivers/clk/clk-lmk04832.c:15:1: iwyu: warning: superfluous #include <linux/debugfs.h>
>> drivers/clk/clk-lmk04832.c:20:1: iwyu: warning: superfluous #include <linux/uaccess.h>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/all/202107110620.926Sm95z-lkp@intel.com/
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
drivers/clk/clk-lmk04832.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index 3a5961fe604d..7e01370fb6d4 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -12,12 +12,10 @@
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
-#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/gcd.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
-#include <linux/uaccess.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
--
2.37.1.223.g6a475b71f8c4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v1 4/4] clk: lmk04832: fix kernel-doc warnings
2022-11-20 3:02 [PATCH v1 0/4] clk: lmk04832: fix minor warnings and syntax issues Liam Beguin
` (2 preceding siblings ...)
2022-11-20 3:02 ` [PATCH v1 3/4] clk: lmk04832: drop superfluous #include Liam Beguin
@ 2022-11-20 3:02 ` Liam Beguin
2022-12-09 1:19 ` Stephen Boyd
3 siblings, 1 reply; 9+ messages in thread
From: Liam Beguin @ 2022-11-20 3:02 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel
Fix syntax generating the following kernel-doc warnings:
drivers/clk/clk-lmk04832.c:189: warning: cannot understand function prototype: 'struct lmk04832_device_info '
drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'pid' not described in 'lmk04832_device_info'
drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'maskrev' not described in 'lmk04832_device_info'
drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'num_channels' not described in 'lmk04832_device_info'
drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'vco0_range' not described in 'lmk04832_device_info'
drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'vco1_range' not described in 'lmk04832_device_info'
drivers/clk/clk-lmk04832.c:420: warning: No description found for return value of 'lmk04832_check_vco_ranges'
drivers/clk/clk-lmk04832.c:459: warning: No description found for return value of 'lmk04832_calc_pll2_params'
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
drivers/clk/clk-lmk04832.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index 7e01370fb6d4..57485356de4c 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -175,14 +175,14 @@ enum lmk04832_device_types {
};
/**
- * lmk04832_device_info - Holds static device information that is specific to
- * the chip revision
+ * struct lmk04832_device_info - Holds static device information that is
+ * specific to the chip revision
*
- * pid: Product Identifier
- * maskrev: IC version identifier
- * num_channels: Number of available output channels (clkout count)
- * vco0_range: {min, max} of the VCO0 operating range (in MHz)
- * vco1_range: {min, max} of the VCO1 operating range (in MHz)
+ * @pid: Product Identifier
+ * @maskrev: IC version identifier
+ * @num_channels: Number of available output channels (clkout count)
+ * @vco0_range: {min, max} of the VCO0 operating range (in MHz)
+ * @vco1_range: {min, max} of the VCO1 operating range (in MHz)
*/
struct lmk04832_device_info {
u16 pid;
@@ -412,7 +412,7 @@ static unsigned long lmk04832_vco_recalc_rate(struct clk_hw *hw,
* The LMK04832 has 2 internal VCO, each with independent operating ranges.
* Use the device_info structure to determine which VCO to use based on rate.
*
- * Returns VCO_MUX value or negative errno.
+ * Returns: VCO_MUX value or negative errno.
*/
static int lmk04832_check_vco_ranges(struct lmk04832 *lmk, unsigned long rate)
{
@@ -449,7 +449,7 @@ static int lmk04832_check_vco_ranges(struct lmk04832 *lmk, unsigned long rate)
*
* VCO = OSCin * 2 * PLL2_N * PLL2_P / PLL2_R
*
- * Returns vco rate or negative errno.
+ * Returns: vco rate or negative errno.
*/
static long lmk04832_calc_pll2_params(unsigned long prate, unsigned long rate,
unsigned int *n, unsigned int *p,
--
2.37.1.223.g6a475b71f8c4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible
2022-11-20 3:02 ` [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible Liam Beguin
@ 2022-12-09 1:19 ` Stephen Boyd
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2022-12-09 1:19 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette; +Cc: linux-clk, linux-kernel, kernel test robot
Quoting Liam Beguin (2022-11-19 19:02:54)
> 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>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 2/4] clk: lmk04832: drop unnecessary semicolons
2022-11-20 3:02 ` [PATCH v1 2/4] clk: lmk04832: drop unnecessary semicolons Liam Beguin
@ 2022-12-09 1:19 ` Stephen Boyd
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2022-12-09 1:19 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette; +Cc: linux-clk, linux-kernel
Quoting Liam Beguin (2022-11-19 19:02:55)
> Semicolons on the closing brace of a function definition are
> unnecessary, remove them.
>
> Signed-off-by: Liam Beguin <liambeguin@gmail.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/4] clk: lmk04832: drop superfluous #include
2022-11-20 3:02 ` [PATCH v1 3/4] clk: lmk04832: drop superfluous #include Liam Beguin
@ 2022-12-09 1:19 ` Stephen Boyd
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2022-12-09 1:19 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette; +Cc: linux-clk, linux-kernel, kernel test robot
Quoting Liam Beguin (2022-11-19 19:02:56)
> iwyu warnings: (new ones prefixed by >>)
> >> drivers/clk/clk-lmk04832.c:15:1: iwyu: warning: superfluous #include <linux/debugfs.h>
> >> drivers/clk/clk-lmk04832.c:20:1: iwyu: warning: superfluous #include <linux/uaccess.h>
>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/all/202107110620.926Sm95z-lkp@intel.com/
> Signed-off-by: Liam Beguin <liambeguin@gmail.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 4/4] clk: lmk04832: fix kernel-doc warnings
2022-11-20 3:02 ` [PATCH v1 4/4] clk: lmk04832: fix kernel-doc warnings Liam Beguin
@ 2022-12-09 1:19 ` Stephen Boyd
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2022-12-09 1:19 UTC (permalink / raw)
To: Liam Beguin, Michael Turquette; +Cc: linux-clk, linux-kernel
Quoting Liam Beguin (2022-11-19 19:02:57)
> Fix syntax generating the following kernel-doc warnings:
>
> drivers/clk/clk-lmk04832.c:189: warning: cannot understand function prototype: 'struct lmk04832_device_info '
> drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'pid' not described in 'lmk04832_device_info'
> drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'maskrev' not described in 'lmk04832_device_info'
> drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'num_channels' not described in 'lmk04832_device_info'
> drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'vco0_range' not described in 'lmk04832_device_info'
> drivers/clk/clk-lmk04832.c:193: warning: Function parameter or member 'vco1_range' not described in 'lmk04832_device_info'
> drivers/clk/clk-lmk04832.c:420: warning: No description found for return value of 'lmk04832_check_vco_ranges'
> drivers/clk/clk-lmk04832.c:459: warning: No description found for return value of 'lmk04832_calc_pll2_params'
>
> Signed-off-by: Liam Beguin <liambeguin@gmail.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-12-09 1:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-20 3:02 [PATCH v1 0/4] clk: lmk04832: fix minor warnings and syntax issues Liam Beguin
2022-11-20 3:02 ` [PATCH v1 1/4] clk: lmk04832: declare variables as const when possible Liam Beguin
2022-12-09 1:19 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).