* [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk()
@ 2022-06-20 8:01 Dmitry Baryshkov
2022-06-21 6:45 ` Dan Carpenter
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-06-20 8:01 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Stephen Boyd, Michael Turquette, Taniya Das
Cc: linux-arm-msm, linux-clk
Switch _qcom_cc_register_board_clk() to use parent_hws.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/clk/qcom/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index 75f09e6e057e..2014484fc66d 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -169,7 +169,7 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
factor->hw.init = &init_data;
init_data.name = name;
- init_data.parent_names = &path;
+ init_data.parent_hws = (const struct clk_hw*[]){ &fixed->hw };
init_data.num_parents = 1;
init_data.flags = 0;
init_data.ops = &clk_fixed_factor_ops;
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk()
2022-06-20 8:01 [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk() Dmitry Baryshkov
2022-06-21 6:45 ` Dan Carpenter
@ 2022-06-21 6:45 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-06-20 19:07 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 6341 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220620080117.1571807-1-dmitry.baryshkov@linaro.org>
References: <20220620080117.1571807-1-dmitry.baryshkov@linaro.org>
TO: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
TO: Andy Gross <agross@kernel.org>
TO: Bjorn Andersson <bjorn.andersson@linaro.org>
TO: Stephen Boyd <swboyd@chromium.org>
TO: Michael Turquette <mturquette@baylibre.com>
TO: Taniya Das <quic_tdas@quicinc.com>
CC: linux-arm-msm(a)vger.kernel.org
CC: linux-clk(a)vger.kernel.org
Hi Dmitry,
I love your patch! Perhaps something to improve:
[auto build test WARNING on clk/clk-next]
[also build test WARNING on linus/master v5.19-rc2 next-20220617]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/clk-qcom-common-use-parent_hws-in-_qcom_cc_register_board_clk/20220620-160242
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220621/202206210257.lD0x1WPz-lkp(a)intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/clk/qcom/common.c:172 _qcom_cc_register_board_clk() error: uninitialized symbol 'fixed'.
vim +/fixed +172 drivers/clk/qcom/common.c
94c51f4073260e Stephen Boyd 2015-10-07 123
ee15faffef1130 Stephen Boyd 2015-10-26 124 /*
ee15faffef1130 Stephen Boyd 2015-10-26 125 * Backwards compatibility with old DTs. Register a pass-through factor 1/1
ad61dd303a0f24 Stephen Boyd 2017-05-08 126 * clock to translate 'path' clk into 'name' clk and register the 'path'
ee15faffef1130 Stephen Boyd 2015-10-26 127 * clk as a fixed rate clock if it isn't present.
ee15faffef1130 Stephen Boyd 2015-10-26 128 */
ee15faffef1130 Stephen Boyd 2015-10-26 129 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
ee15faffef1130 Stephen Boyd 2015-10-26 130 const char *name, unsigned long rate,
ee15faffef1130 Stephen Boyd 2015-10-26 131 bool add_factor)
ee15faffef1130 Stephen Boyd 2015-10-26 132 {
ee15faffef1130 Stephen Boyd 2015-10-26 133 struct device_node *node = NULL;
ee15faffef1130 Stephen Boyd 2015-10-26 134 struct device_node *clocks_node;
ee15faffef1130 Stephen Boyd 2015-10-26 135 struct clk_fixed_factor *factor;
ee15faffef1130 Stephen Boyd 2015-10-26 136 struct clk_fixed_rate *fixed;
ee15faffef1130 Stephen Boyd 2015-10-26 137 struct clk_init_data init_data = { };
120c1552839036 Stephen Boyd 2016-08-16 138 int ret;
ee15faffef1130 Stephen Boyd 2015-10-26 139
ee15faffef1130 Stephen Boyd 2015-10-26 140 clocks_node = of_find_node_by_path("/clocks");
43a51019cc8ff1 Johan Hovold 2017-11-11 141 if (clocks_node) {
43a51019cc8ff1 Johan Hovold 2017-11-11 142 node = of_get_child_by_name(clocks_node, path);
43a51019cc8ff1 Johan Hovold 2017-11-11 143 of_node_put(clocks_node);
43a51019cc8ff1 Johan Hovold 2017-11-11 144 }
ee15faffef1130 Stephen Boyd 2015-10-26 145
ee15faffef1130 Stephen Boyd 2015-10-26 146 if (!node) {
ee15faffef1130 Stephen Boyd 2015-10-26 147 fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
ee15faffef1130 Stephen Boyd 2015-10-26 148 if (!fixed)
ee15faffef1130 Stephen Boyd 2015-10-26 149 return -EINVAL;
ee15faffef1130 Stephen Boyd 2015-10-26 150
ee15faffef1130 Stephen Boyd 2015-10-26 151 fixed->fixed_rate = rate;
ee15faffef1130 Stephen Boyd 2015-10-26 152 fixed->hw.init = &init_data;
ee15faffef1130 Stephen Boyd 2015-10-26 153
ee15faffef1130 Stephen Boyd 2015-10-26 154 init_data.name = path;
ee15faffef1130 Stephen Boyd 2015-10-26 155 init_data.ops = &clk_fixed_rate_ops;
ee15faffef1130 Stephen Boyd 2015-10-26 156
120c1552839036 Stephen Boyd 2016-08-16 157 ret = devm_clk_hw_register(dev, &fixed->hw);
120c1552839036 Stephen Boyd 2016-08-16 158 if (ret)
120c1552839036 Stephen Boyd 2016-08-16 159 return ret;
ee15faffef1130 Stephen Boyd 2015-10-26 160 }
ee15faffef1130 Stephen Boyd 2015-10-26 161 of_node_put(node);
ee15faffef1130 Stephen Boyd 2015-10-26 162
ee15faffef1130 Stephen Boyd 2015-10-26 163 if (add_factor) {
ee15faffef1130 Stephen Boyd 2015-10-26 164 factor = devm_kzalloc(dev, sizeof(*factor), GFP_KERNEL);
ee15faffef1130 Stephen Boyd 2015-10-26 165 if (!factor)
ee15faffef1130 Stephen Boyd 2015-10-26 166 return -EINVAL;
ee15faffef1130 Stephen Boyd 2015-10-26 167
ee15faffef1130 Stephen Boyd 2015-10-26 168 factor->mult = factor->div = 1;
ee15faffef1130 Stephen Boyd 2015-10-26 169 factor->hw.init = &init_data;
ee15faffef1130 Stephen Boyd 2015-10-26 170
ee15faffef1130 Stephen Boyd 2015-10-26 171 init_data.name = name;
daa853a735065a Dmitry Baryshkov 2022-06-20 @172 init_data.parent_hws = (const struct clk_hw*[]){ &fixed->hw };
ee15faffef1130 Stephen Boyd 2015-10-26 173 init_data.num_parents = 1;
ee15faffef1130 Stephen Boyd 2015-10-26 174 init_data.flags = 0;
ee15faffef1130 Stephen Boyd 2015-10-26 175 init_data.ops = &clk_fixed_factor_ops;
ee15faffef1130 Stephen Boyd 2015-10-26 176
120c1552839036 Stephen Boyd 2016-08-16 177 ret = devm_clk_hw_register(dev, &factor->hw);
120c1552839036 Stephen Boyd 2016-08-16 178 if (ret)
120c1552839036 Stephen Boyd 2016-08-16 179 return ret;
ee15faffef1130 Stephen Boyd 2015-10-26 180 }
ee15faffef1130 Stephen Boyd 2015-10-26 181
ee15faffef1130 Stephen Boyd 2015-10-26 182 return 0;
ee15faffef1130 Stephen Boyd 2015-10-26 183 }
ee15faffef1130 Stephen Boyd 2015-10-26 184
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [kbuild] Re: [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk()
@ 2022-06-21 6:45 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2022-06-21 6:45 UTC (permalink / raw)
To: kbuild, Dmitry Baryshkov, Andy Gross, Bjorn Andersson,
Stephen Boyd, Michael Turquette, Taniya Das
Cc: lkp, kbuild-all, linux-arm-msm, linux-clk
Hi Dmitry,
url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/clk-qcom-common-use-parent_hws-in-_qcom_cc_register_board_clk/20220620-160242
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220621/202206210257.lD0x1WPz-lkp@intel.com/config )
compiler: hppa-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/clk/qcom/common.c:172 _qcom_cc_register_board_clk() error: uninitialized symbol 'fixed'.
vim +/fixed +172 drivers/clk/qcom/common.c
ee15faffef1130 Stephen Boyd 2015-10-26 129 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
ee15faffef1130 Stephen Boyd 2015-10-26 130 const char *name, unsigned long rate,
ee15faffef1130 Stephen Boyd 2015-10-26 131 bool add_factor)
ee15faffef1130 Stephen Boyd 2015-10-26 132 {
ee15faffef1130 Stephen Boyd 2015-10-26 133 struct device_node *node = NULL;
ee15faffef1130 Stephen Boyd 2015-10-26 134 struct device_node *clocks_node;
ee15faffef1130 Stephen Boyd 2015-10-26 135 struct clk_fixed_factor *factor;
ee15faffef1130 Stephen Boyd 2015-10-26 136 struct clk_fixed_rate *fixed;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ee15faffef1130 Stephen Boyd 2015-10-26 137 struct clk_init_data init_data = { };
120c1552839036 Stephen Boyd 2016-08-16 138 int ret;
ee15faffef1130 Stephen Boyd 2015-10-26 139
ee15faffef1130 Stephen Boyd 2015-10-26 140 clocks_node = of_find_node_by_path("/clocks");
43a51019cc8ff1 Johan Hovold 2017-11-11 141 if (clocks_node) {
43a51019cc8ff1 Johan Hovold 2017-11-11 142 node = of_get_child_by_name(clocks_node, path);
43a51019cc8ff1 Johan Hovold 2017-11-11 143 of_node_put(clocks_node);
43a51019cc8ff1 Johan Hovold 2017-11-11 144 }
ee15faffef1130 Stephen Boyd 2015-10-26 145
ee15faffef1130 Stephen Boyd 2015-10-26 146 if (!node) {
ee15faffef1130 Stephen Boyd 2015-10-26 147 fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
ee15faffef1130 Stephen Boyd 2015-10-26 148 if (!fixed)
ee15faffef1130 Stephen Boyd 2015-10-26 149 return -EINVAL;
ee15faffef1130 Stephen Boyd 2015-10-26 150
ee15faffef1130 Stephen Boyd 2015-10-26 151 fixed->fixed_rate = rate;
ee15faffef1130 Stephen Boyd 2015-10-26 152 fixed->hw.init = &init_data;
ee15faffef1130 Stephen Boyd 2015-10-26 153
ee15faffef1130 Stephen Boyd 2015-10-26 154 init_data.name = path;
ee15faffef1130 Stephen Boyd 2015-10-26 155 init_data.ops = &clk_fixed_rate_ops;
ee15faffef1130 Stephen Boyd 2015-10-26 156
120c1552839036 Stephen Boyd 2016-08-16 157 ret = devm_clk_hw_register(dev, &fixed->hw);
120c1552839036 Stephen Boyd 2016-08-16 158 if (ret)
120c1552839036 Stephen Boyd 2016-08-16 159 return ret;
ee15faffef1130 Stephen Boyd 2015-10-26 160 }
"fixed" is not set on else path.
ee15faffef1130 Stephen Boyd 2015-10-26 161 of_node_put(node);
ee15faffef1130 Stephen Boyd 2015-10-26 162
ee15faffef1130 Stephen Boyd 2015-10-26 163 if (add_factor) {
ee15faffef1130 Stephen Boyd 2015-10-26 164 factor = devm_kzalloc(dev, sizeof(*factor), GFP_KERNEL);
ee15faffef1130 Stephen Boyd 2015-10-26 165 if (!factor)
ee15faffef1130 Stephen Boyd 2015-10-26 166 return -EINVAL;
ee15faffef1130 Stephen Boyd 2015-10-26 167
ee15faffef1130 Stephen Boyd 2015-10-26 168 factor->mult = factor->div = 1;
ee15faffef1130 Stephen Boyd 2015-10-26 169 factor->hw.init = &init_data;
ee15faffef1130 Stephen Boyd 2015-10-26 170
ee15faffef1130 Stephen Boyd 2015-10-26 171 init_data.name = name;
daa853a735065a Dmitry Baryshkov 2022-06-20 @172 init_data.parent_hws = (const struct clk_hw*[]){ &fixed->hw };
^^^^^
Used here. This would work if fixed were set to NULL at the start but
I kind of hate that it requires us to know that ->hw is the first member
of fixed struct.
ee15faffef1130 Stephen Boyd 2015-10-26 173 init_data.num_parents = 1;
ee15faffef1130 Stephen Boyd 2015-10-26 174 init_data.flags = 0;
ee15faffef1130 Stephen Boyd 2015-10-26 175 init_data.ops = &clk_fixed_factor_ops;
ee15faffef1130 Stephen Boyd 2015-10-26 176
120c1552839036 Stephen Boyd 2016-08-16 177 ret = devm_clk_hw_register(dev, &factor->hw);
120c1552839036 Stephen Boyd 2016-08-16 178 if (ret)
120c1552839036 Stephen Boyd 2016-08-16 179 return ret;
ee15faffef1130 Stephen Boyd 2015-10-26 180 }
ee15faffef1130 Stephen Boyd 2015-10-26 181
ee15faffef1130 Stephen Boyd 2015-10-26 182 return 0;
ee15faffef1130 Stephen Boyd 2015-10-26 183 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* [kbuild] Re: [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk()
@ 2022-06-21 6:45 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2022-06-21 6:45 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5408 bytes --]
Hi Dmitry,
url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/clk-qcom-common-use-parent_hws-in-_qcom_cc_register_board_clk/20220620-160242
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220621/202206210257.lD0x1WPz-lkp(a)intel.com/config )
compiler: hppa-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/clk/qcom/common.c:172 _qcom_cc_register_board_clk() error: uninitialized symbol 'fixed'.
vim +/fixed +172 drivers/clk/qcom/common.c
ee15faffef1130 Stephen Boyd 2015-10-26 129 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
ee15faffef1130 Stephen Boyd 2015-10-26 130 const char *name, unsigned long rate,
ee15faffef1130 Stephen Boyd 2015-10-26 131 bool add_factor)
ee15faffef1130 Stephen Boyd 2015-10-26 132 {
ee15faffef1130 Stephen Boyd 2015-10-26 133 struct device_node *node = NULL;
ee15faffef1130 Stephen Boyd 2015-10-26 134 struct device_node *clocks_node;
ee15faffef1130 Stephen Boyd 2015-10-26 135 struct clk_fixed_factor *factor;
ee15faffef1130 Stephen Boyd 2015-10-26 136 struct clk_fixed_rate *fixed;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ee15faffef1130 Stephen Boyd 2015-10-26 137 struct clk_init_data init_data = { };
120c1552839036 Stephen Boyd 2016-08-16 138 int ret;
ee15faffef1130 Stephen Boyd 2015-10-26 139
ee15faffef1130 Stephen Boyd 2015-10-26 140 clocks_node = of_find_node_by_path("/clocks");
43a51019cc8ff1 Johan Hovold 2017-11-11 141 if (clocks_node) {
43a51019cc8ff1 Johan Hovold 2017-11-11 142 node = of_get_child_by_name(clocks_node, path);
43a51019cc8ff1 Johan Hovold 2017-11-11 143 of_node_put(clocks_node);
43a51019cc8ff1 Johan Hovold 2017-11-11 144 }
ee15faffef1130 Stephen Boyd 2015-10-26 145
ee15faffef1130 Stephen Boyd 2015-10-26 146 if (!node) {
ee15faffef1130 Stephen Boyd 2015-10-26 147 fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
ee15faffef1130 Stephen Boyd 2015-10-26 148 if (!fixed)
ee15faffef1130 Stephen Boyd 2015-10-26 149 return -EINVAL;
ee15faffef1130 Stephen Boyd 2015-10-26 150
ee15faffef1130 Stephen Boyd 2015-10-26 151 fixed->fixed_rate = rate;
ee15faffef1130 Stephen Boyd 2015-10-26 152 fixed->hw.init = &init_data;
ee15faffef1130 Stephen Boyd 2015-10-26 153
ee15faffef1130 Stephen Boyd 2015-10-26 154 init_data.name = path;
ee15faffef1130 Stephen Boyd 2015-10-26 155 init_data.ops = &clk_fixed_rate_ops;
ee15faffef1130 Stephen Boyd 2015-10-26 156
120c1552839036 Stephen Boyd 2016-08-16 157 ret = devm_clk_hw_register(dev, &fixed->hw);
120c1552839036 Stephen Boyd 2016-08-16 158 if (ret)
120c1552839036 Stephen Boyd 2016-08-16 159 return ret;
ee15faffef1130 Stephen Boyd 2015-10-26 160 }
"fixed" is not set on else path.
ee15faffef1130 Stephen Boyd 2015-10-26 161 of_node_put(node);
ee15faffef1130 Stephen Boyd 2015-10-26 162
ee15faffef1130 Stephen Boyd 2015-10-26 163 if (add_factor) {
ee15faffef1130 Stephen Boyd 2015-10-26 164 factor = devm_kzalloc(dev, sizeof(*factor), GFP_KERNEL);
ee15faffef1130 Stephen Boyd 2015-10-26 165 if (!factor)
ee15faffef1130 Stephen Boyd 2015-10-26 166 return -EINVAL;
ee15faffef1130 Stephen Boyd 2015-10-26 167
ee15faffef1130 Stephen Boyd 2015-10-26 168 factor->mult = factor->div = 1;
ee15faffef1130 Stephen Boyd 2015-10-26 169 factor->hw.init = &init_data;
ee15faffef1130 Stephen Boyd 2015-10-26 170
ee15faffef1130 Stephen Boyd 2015-10-26 171 init_data.name = name;
daa853a735065a Dmitry Baryshkov 2022-06-20 @172 init_data.parent_hws = (const struct clk_hw*[]){ &fixed->hw };
^^^^^
Used here. This would work if fixed were set to NULL at the start but
I kind of hate that it requires us to know that ->hw is the first member
of fixed struct.
ee15faffef1130 Stephen Boyd 2015-10-26 173 init_data.num_parents = 1;
ee15faffef1130 Stephen Boyd 2015-10-26 174 init_data.flags = 0;
ee15faffef1130 Stephen Boyd 2015-10-26 175 init_data.ops = &clk_fixed_factor_ops;
ee15faffef1130 Stephen Boyd 2015-10-26 176
120c1552839036 Stephen Boyd 2016-08-16 177 ret = devm_clk_hw_register(dev, &factor->hw);
120c1552839036 Stephen Boyd 2016-08-16 178 if (ret)
120c1552839036 Stephen Boyd 2016-08-16 179 return ret;
ee15faffef1130 Stephen Boyd 2015-10-26 180 }
ee15faffef1130 Stephen Boyd 2015-10-26 181
ee15faffef1130 Stephen Boyd 2015-10-26 182 return 0;
ee15faffef1130 Stephen Boyd 2015-10-26 183 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbuild] Re: [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk()
2022-06-21 6:45 ` Dan Carpenter
@ 2022-06-21 6:54 ` Dmitry Baryshkov
-1 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-06-21 6:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: kbuild, Andy Gross, Bjorn Andersson, Stephen Boyd,
Michael Turquette, Taniya Das, lkp, kbuild-all, linux-arm-msm,
linux-clk
On Tue, 21 Jun 2022 at 09:46, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hi Dmitry,
>
> url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/clk-qcom-common-use-parent_hws-in-_qcom_cc_register_board_clk/20220620-160242
> base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
> config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220621/202206210257.lD0x1WPz-lkp@intel.com/config )
> compiler: hppa-linux-gcc (GCC) 11.3.0
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/clk/qcom/common.c:172 _qcom_cc_register_board_clk() error: uninitialized symbol 'fixed'.
>
> vim +/fixed +172 drivers/clk/qcom/common.c
>
> ee15faffef1130 Stephen Boyd 2015-10-26 129 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
> ee15faffef1130 Stephen Boyd 2015-10-26 130 const char *name, unsigned long rate,
> ee15faffef1130 Stephen Boyd 2015-10-26 131 bool add_factor)
> ee15faffef1130 Stephen Boyd 2015-10-26 132 {
> ee15faffef1130 Stephen Boyd 2015-10-26 133 struct device_node *node = NULL;
> ee15faffef1130 Stephen Boyd 2015-10-26 134 struct device_node *clocks_node;
> ee15faffef1130 Stephen Boyd 2015-10-26 135 struct clk_fixed_factor *factor;
> ee15faffef1130 Stephen Boyd 2015-10-26 136 struct clk_fixed_rate *fixed;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> ee15faffef1130 Stephen Boyd 2015-10-26 137 struct clk_init_data init_data = { };
> 120c1552839036 Stephen Boyd 2016-08-16 138 int ret;
> ee15faffef1130 Stephen Boyd 2015-10-26 139
> ee15faffef1130 Stephen Boyd 2015-10-26 140 clocks_node = of_find_node_by_path("/clocks");
> 43a51019cc8ff1 Johan Hovold 2017-11-11 141 if (clocks_node) {
> 43a51019cc8ff1 Johan Hovold 2017-11-11 142 node = of_get_child_by_name(clocks_node, path);
> 43a51019cc8ff1 Johan Hovold 2017-11-11 143 of_node_put(clocks_node);
> 43a51019cc8ff1 Johan Hovold 2017-11-11 144 }
> ee15faffef1130 Stephen Boyd 2015-10-26 145
> ee15faffef1130 Stephen Boyd 2015-10-26 146 if (!node) {
> ee15faffef1130 Stephen Boyd 2015-10-26 147 fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
> ee15faffef1130 Stephen Boyd 2015-10-26 148 if (!fixed)
> ee15faffef1130 Stephen Boyd 2015-10-26 149 return -EINVAL;
> ee15faffef1130 Stephen Boyd 2015-10-26 150
> ee15faffef1130 Stephen Boyd 2015-10-26 151 fixed->fixed_rate = rate;
> ee15faffef1130 Stephen Boyd 2015-10-26 152 fixed->hw.init = &init_data;
> ee15faffef1130 Stephen Boyd 2015-10-26 153
> ee15faffef1130 Stephen Boyd 2015-10-26 154 init_data.name = path;
> ee15faffef1130 Stephen Boyd 2015-10-26 155 init_data.ops = &clk_fixed_rate_ops;
> ee15faffef1130 Stephen Boyd 2015-10-26 156
> 120c1552839036 Stephen Boyd 2016-08-16 157 ret = devm_clk_hw_register(dev, &fixed->hw);
> 120c1552839036 Stephen Boyd 2016-08-16 158 if (ret)
> 120c1552839036 Stephen Boyd 2016-08-16 159 return ret;
> ee15faffef1130 Stephen Boyd 2015-10-26 160 }
>
> "fixed" is not set on else path.
>
> ee15faffef1130 Stephen Boyd 2015-10-26 161 of_node_put(node);
> ee15faffef1130 Stephen Boyd 2015-10-26 162
> ee15faffef1130 Stephen Boyd 2015-10-26 163 if (add_factor) {
> ee15faffef1130 Stephen Boyd 2015-10-26 164 factor = devm_kzalloc(dev, sizeof(*factor), GFP_KERNEL);
> ee15faffef1130 Stephen Boyd 2015-10-26 165 if (!factor)
> ee15faffef1130 Stephen Boyd 2015-10-26 166 return -EINVAL;
> ee15faffef1130 Stephen Boyd 2015-10-26 167
> ee15faffef1130 Stephen Boyd 2015-10-26 168 factor->mult = factor->div = 1;
> ee15faffef1130 Stephen Boyd 2015-10-26 169 factor->hw.init = &init_data;
> ee15faffef1130 Stephen Boyd 2015-10-26 170
> ee15faffef1130 Stephen Boyd 2015-10-26 171 init_data.name = name;
> daa853a735065a Dmitry Baryshkov 2022-06-20 @172 init_data.parent_hws = (const struct clk_hw*[]){ &fixed->hw };
> ^^^^^
> Used here. This would work if fixed were set to NULL at the start but
> I kind of hate that it requires us to know that ->hw is the first member
> of fixed struct.
Thanks for reporting this. The problem is a bit worse. If the node
exists, we are expected to use the existing global clock here instead
of the newly created 'fixed' clock.
>
> ee15faffef1130 Stephen Boyd 2015-10-26 173 init_data.num_parents = 1;
> ee15faffef1130 Stephen Boyd 2015-10-26 174 init_data.flags = 0;
> ee15faffef1130 Stephen Boyd 2015-10-26 175 init_data.ops = &clk_fixed_factor_ops;
> ee15faffef1130 Stephen Boyd 2015-10-26 176
> 120c1552839036 Stephen Boyd 2016-08-16 177 ret = devm_clk_hw_register(dev, &factor->hw);
> 120c1552839036 Stephen Boyd 2016-08-16 178 if (ret)
> 120c1552839036 Stephen Boyd 2016-08-16 179 return ret;
> ee15faffef1130 Stephen Boyd 2015-10-26 180 }
> ee15faffef1130 Stephen Boyd 2015-10-26 181
> ee15faffef1130 Stephen Boyd 2015-10-26 182 return 0;
> ee15faffef1130 Stephen Boyd 2015-10-26 183 }
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
> _______________________________________________
> kbuild mailing list -- kbuild@lists.01.org
> To unsubscribe send an email to kbuild-leave@lists.01.org
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbuild] Re: [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk()
@ 2022-06-21 6:54 ` Dmitry Baryshkov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-06-21 6:54 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 6346 bytes --]
On Tue, 21 Jun 2022 at 09:46, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hi Dmitry,
>
> url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/clk-qcom-common-use-parent_hws-in-_qcom_cc_register_board_clk/20220620-160242
> base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
> config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220621/202206210257.lD0x1WPz-lkp(a)intel.com/config )
> compiler: hppa-linux-gcc (GCC) 11.3.0
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/clk/qcom/common.c:172 _qcom_cc_register_board_clk() error: uninitialized symbol 'fixed'.
>
> vim +/fixed +172 drivers/clk/qcom/common.c
>
> ee15faffef1130 Stephen Boyd 2015-10-26 129 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
> ee15faffef1130 Stephen Boyd 2015-10-26 130 const char *name, unsigned long rate,
> ee15faffef1130 Stephen Boyd 2015-10-26 131 bool add_factor)
> ee15faffef1130 Stephen Boyd 2015-10-26 132 {
> ee15faffef1130 Stephen Boyd 2015-10-26 133 struct device_node *node = NULL;
> ee15faffef1130 Stephen Boyd 2015-10-26 134 struct device_node *clocks_node;
> ee15faffef1130 Stephen Boyd 2015-10-26 135 struct clk_fixed_factor *factor;
> ee15faffef1130 Stephen Boyd 2015-10-26 136 struct clk_fixed_rate *fixed;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> ee15faffef1130 Stephen Boyd 2015-10-26 137 struct clk_init_data init_data = { };
> 120c1552839036 Stephen Boyd 2016-08-16 138 int ret;
> ee15faffef1130 Stephen Boyd 2015-10-26 139
> ee15faffef1130 Stephen Boyd 2015-10-26 140 clocks_node = of_find_node_by_path("/clocks");
> 43a51019cc8ff1 Johan Hovold 2017-11-11 141 if (clocks_node) {
> 43a51019cc8ff1 Johan Hovold 2017-11-11 142 node = of_get_child_by_name(clocks_node, path);
> 43a51019cc8ff1 Johan Hovold 2017-11-11 143 of_node_put(clocks_node);
> 43a51019cc8ff1 Johan Hovold 2017-11-11 144 }
> ee15faffef1130 Stephen Boyd 2015-10-26 145
> ee15faffef1130 Stephen Boyd 2015-10-26 146 if (!node) {
> ee15faffef1130 Stephen Boyd 2015-10-26 147 fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
> ee15faffef1130 Stephen Boyd 2015-10-26 148 if (!fixed)
> ee15faffef1130 Stephen Boyd 2015-10-26 149 return -EINVAL;
> ee15faffef1130 Stephen Boyd 2015-10-26 150
> ee15faffef1130 Stephen Boyd 2015-10-26 151 fixed->fixed_rate = rate;
> ee15faffef1130 Stephen Boyd 2015-10-26 152 fixed->hw.init = &init_data;
> ee15faffef1130 Stephen Boyd 2015-10-26 153
> ee15faffef1130 Stephen Boyd 2015-10-26 154 init_data.name = path;
> ee15faffef1130 Stephen Boyd 2015-10-26 155 init_data.ops = &clk_fixed_rate_ops;
> ee15faffef1130 Stephen Boyd 2015-10-26 156
> 120c1552839036 Stephen Boyd 2016-08-16 157 ret = devm_clk_hw_register(dev, &fixed->hw);
> 120c1552839036 Stephen Boyd 2016-08-16 158 if (ret)
> 120c1552839036 Stephen Boyd 2016-08-16 159 return ret;
> ee15faffef1130 Stephen Boyd 2015-10-26 160 }
>
> "fixed" is not set on else path.
>
> ee15faffef1130 Stephen Boyd 2015-10-26 161 of_node_put(node);
> ee15faffef1130 Stephen Boyd 2015-10-26 162
> ee15faffef1130 Stephen Boyd 2015-10-26 163 if (add_factor) {
> ee15faffef1130 Stephen Boyd 2015-10-26 164 factor = devm_kzalloc(dev, sizeof(*factor), GFP_KERNEL);
> ee15faffef1130 Stephen Boyd 2015-10-26 165 if (!factor)
> ee15faffef1130 Stephen Boyd 2015-10-26 166 return -EINVAL;
> ee15faffef1130 Stephen Boyd 2015-10-26 167
> ee15faffef1130 Stephen Boyd 2015-10-26 168 factor->mult = factor->div = 1;
> ee15faffef1130 Stephen Boyd 2015-10-26 169 factor->hw.init = &init_data;
> ee15faffef1130 Stephen Boyd 2015-10-26 170
> ee15faffef1130 Stephen Boyd 2015-10-26 171 init_data.name = name;
> daa853a735065a Dmitry Baryshkov 2022-06-20 @172 init_data.parent_hws = (const struct clk_hw*[]){ &fixed->hw };
> ^^^^^
> Used here. This would work if fixed were set to NULL at the start but
> I kind of hate that it requires us to know that ->hw is the first member
> of fixed struct.
Thanks for reporting this. The problem is a bit worse. If the node
exists, we are expected to use the existing global clock here instead
of the newly created 'fixed' clock.
>
> ee15faffef1130 Stephen Boyd 2015-10-26 173 init_data.num_parents = 1;
> ee15faffef1130 Stephen Boyd 2015-10-26 174 init_data.flags = 0;
> ee15faffef1130 Stephen Boyd 2015-10-26 175 init_data.ops = &clk_fixed_factor_ops;
> ee15faffef1130 Stephen Boyd 2015-10-26 176
> 120c1552839036 Stephen Boyd 2016-08-16 177 ret = devm_clk_hw_register(dev, &factor->hw);
> 120c1552839036 Stephen Boyd 2016-08-16 178 if (ret)
> 120c1552839036 Stephen Boyd 2016-08-16 179 return ret;
> ee15faffef1130 Stephen Boyd 2015-10-26 180 }
> ee15faffef1130 Stephen Boyd 2015-10-26 181
> ee15faffef1130 Stephen Boyd 2015-10-26 182 return 0;
> ee15faffef1130 Stephen Boyd 2015-10-26 183 }
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
> _______________________________________________
> kbuild mailing list -- kbuild(a)lists.01.org
> To unsubscribe send an email to kbuild-leave(a)lists.01.org
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-21 6:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20 8:01 [PATCH] clk: qcom: common: use parent_hws in _qcom_cc_register_board_clk() Dmitry Baryshkov
2022-06-20 19:07 ` kernel test robot
2022-06-21 6:45 ` [kbuild] " Dan Carpenter
2022-06-21 6:45 ` Dan Carpenter
2022-06-21 6:54 ` Dmitry Baryshkov
2022-06-21 6:54 ` Dmitry Baryshkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.