Skip to contentSkip to conversation

clk: si5351: Constify clock names and struct regmap_config

PATCH RESEND Applied Krzysztof Kozlowski 3 participants 9 messages Mar 20, 2015 – Mar 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/3 clk: si5351: Constify clock names and struct regmap_config

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

Replace doubled const in the arrays of clock names with proper const pointer to const data. This fixes the warnings:

drivers/clk/clk-si5351.c:71:25: warning: duplicate const drivers/clk/clk-si5351.c:74:25: warning: duplicate const drivers/clk/clk-si5351.c:77:25: warning: duplicate const drivers/clk/clk-si5351.c:80:25: warning: duplicate const

---
 drivers/clk/clk-si5351.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/clk/clk-si5351.c +5 -5
index 3b2a66f78755..44ea107cfc67 100644
@@ -68,16 +68,16 @@ struct si5351_driver_data {
 	struct si5351_hw_data	*clkout;
 };
 
-static const char const *si5351_input_names[] = {
+static const char * const si5351_input_names[] = {
 	"xtal", "clkin"
 };
-static const char const *si5351_pll_names[] = {
+static const char * const si5351_pll_names[] = {
 	"plla", "pllb", "vxco"
 };
-static const char const *si5351_msynth_names[] = {
+static const char * const si5351_msynth_names[] = {
 	"ms0", "ms1", "ms2", "ms3", "ms4", "ms5", "ms6", "ms7"
 };
-static const char const *si5351_clkout_names[] = {
+static const char * const si5351_clkout_names[] = {
 	"clk0", "clk1", "clk2", "clk3", "clk4", "clk5", "clk6", "clk7"
 };
 
@@ -207,7 +207,7 @@ static bool si5351_regmap_is_writeable(struct device *dev, unsigned int reg)
 	return true;
 }
 
-static struct regmap_config si5351_regmap_config = {
+static const struct regmap_config si5351_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.cache_type = REGCACHE_RBTREE,
Signature · 1 line
1.9.1
#1 lore raw

PATCH RESEND 2/3 clk: si570: Constify struct regmap_config

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

---
 drivers/clk/clk-si570.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-si570.c +1 -1
index fc167b3f8919..20a5aec98b1a 100644
@@ -393,7 +393,7 @@ static bool si570_regmap_is_writeable(struct device *dev, unsigned int reg)
 	}
 }
 
-static struct regmap_config si570_regmap_config = {
+static const struct regmap_config si570_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.cache_type = REGCACHE_RBTREE,
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 2/3
#2 lore raw

Re: [RESEND PATCH 2/3] clk: si570: Constify struct regmap_config

Quoted 7 lines · Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

---
 drivers/clk/clk-si570.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
Thanks.
-- Max
Applied
#3 lore raw

Re: [RESEND PATCH 2/3] clk: si570: Constify struct regmap_config

Quoted 5 lines · Max Filippov
Quoted 3 lines · Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

Quoted 7 lines
Quoted 4 lines
---
 drivers/clk/clk-si570.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to clk-next

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

PATCH RESEND 3/3 clk: cdce706: Constify struct regmap_config

In reply to Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

---
 drivers/clk/clk-cdce706.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-cdce706.c +1 -1
index c386ad25beb4..b8e4f8a822e9 100644
@@ -58,7 +58,7 @@
 #define CDCE706_CLKOUT_DIVIDER_MASK	0x7
 #define CDCE706_CLKOUT_ENABLE_MASK	0x8
 
-static struct regmap_config cdce706_regmap_config = {
+static const struct regmap_config cdce706_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.val_format_endian = REGMAP_ENDIAN_NATIVE,
Signature · 1 line
1.9.1
maintainer Acked-by on v1 3/3
#5 lore raw

Re: [RESEND PATCH 3/3] clk: cdce706: Constify struct regmap_config

Quoted 7 lines · Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

---
 drivers/clk/clk-cdce706.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
Thanks.
-- Max
Applied
#6 lore raw

Re: [RESEND PATCH 3/3] clk: cdce706: Constify struct regmap_config

Quoted 5 lines · Max Filippov
Quoted 3 lines · Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

Quoted 7 lines
Quoted 4 lines
---
 drivers/clk/clk-cdce706.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer Reviewed-by on v1 1/3
#7 lore raw
In reply to Krzysztof Kozlowski
Quoted 11 lines · Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

Replace doubled const in the arrays of clock names with proper const pointer to const data. This fixes the warnings:

drivers/clk/clk-si5351.c:71:25: warning: duplicate const drivers/clk/clk-si5351.c:74:25: warning: duplicate const drivers/clk/clk-si5351.c:77:25: warning: duplicate const drivers/clk/clk-si5351.c:80:25: warning: duplicate const

Quoted 4 lines
---
 drivers/clk/clk-si5351.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 2 lines
Thanks.
-- Max
Applied
#8 lore raw
Quoted 13 lines · Max Filippov
Quoted 11 lines · Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const.

Replace doubled const in the arrays of clock names with proper const pointer to const data. This fixes the warnings:

drivers/clk/clk-si5351.c:71:25: warning: duplicate const drivers/clk/clk-si5351.c:74:25: warning: duplicate const drivers/clk/clk-si5351.c:77:25: warning: duplicate const drivers/clk/clk-si5351.c:80:25: warning: duplicate const

Quoted 7 lines
Quoted 4 lines
---
 drivers/clk/clk-si5351.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Applied to clk-next

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