Skip to contentSkip to conversation

clk: h8300: Fix signness bug

PATCH In review Axel Lin 2 participants 4 messages Jun 20, 2015 – Jul 14, 2015 Common clk

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 clk: h8300: Fix signness bug

of_clk_get_parent_count() may return negative error code, so num_parents needs to be int rather than unsigned int.

---
 drivers/clk/h8300/clk-div.c     | 2 +-
 drivers/clk/h8300/clk-h8s2678.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/clk/h8300/clk-div.c +1 -1
index 56f9eba..e13d5c3 100644
@@ -15,7 +15,7 @@ static DEFINE_SPINLOCK(clklock);
 
 static void __init h8300_div_clk_setup(struct device_node *node)
 {
-	unsigned int num_parents;
+	int num_parents;
 	struct clk *clk;
 	const char *clk_name = node->name;
 	const char *parent_name;
drivers/clk/h8300/clk-h8s2678.c +1 -1
index 4701b093..26c07aa 100644
@@ -84,7 +84,7 @@ static const struct clk_ops pll_ops = {
 
 static void __init h8s2678_pll_clk_setup(struct device_node *node)
 {
-	unsigned int num_parents;
+	int num_parents;
 	struct clk *clk;
 	const char *clk_name = node->name;
 	const char *parent_name;
Signature · 1 line
2.1.0
#1 lore raw
Quoted 5 lines · Axel Lin

of_clk_get_parent_count() may return negative error code, so num_parents needs to be int rather than unsigned int.

---

Hmph. I don't recall being Cced on this clk driver and it looks to be in linux-next via h8300 architecture tree. This patch should probably be squashed into the patch that introduced the problem.

Signature · 4 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
author
#2 lore raw

2015-06-23 7:04 GMT+08:00 Stephen Boyd <[email protected]>:

Quoted 11 lines · Axel Lin
Quoted 5 lines

of_clk_get_parent_count() may return negative error code, so num_parents needs to be int rather than unsigned int.

---

Hmph. I don't recall being Cced on this clk driver and it looks to be in linux-next via h8300 architecture tree. This patch should probably be squashed into the patch that introduced the problem.

Hi Stephen,
This driver is already in Linus' tree.
So would you pick up this patch?

Thanks,
Axel

#3 lore raw
Quoted 8 lines · Axel Lin

2015-06-23 7:04 GMT+08:00 Stephen Boyd <[email protected]>:

Quoted 7 lines · Axel Lin
Quoted 5 lines

of_clk_get_parent_count() may return negative error code, so num_parents needs to be int rather than unsigned int.

---

Quoted 8 lines
Quoted 4 lines

Hmph. I don't recall being Cced on this clk driver and it looks to be in linux-next via h8300 architecture tree. This patch should probably be squashed into the patch that introduced the problem.

Hi Stephen,
This driver is already in Linus' tree.
So would you pick up this patch?

Yep. Applied to clk-fixes.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project