Skip to contentSkip to conversation

drivers/clk/sunxi/clk-sunxi.c: small improvement of code

PATCH New Giacomo Catenazzi 3 participants 3 messages May 17, 2013 – May 29, 2013

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

PATCH 1/1 drivers/clk/sunxi/clk-sunxi.c: small improvement of code

Hello Emilio,

please apply the following patch: "cpu_data" is defined in a header files of architectures.
In some architecture, the #define cpu_data is not a "macro-function", so the compiler will substitute the identifier with probably something wrong.

drivers/clk/sunxi/clk-sunxi.c +2 -2
@@ -239,7 +239,7 @@ struct mux_data {
        u8 shift;
 };
 
-static const __initconst struct mux_data cpu_data = {
+static const __initconst struct mux_data this_cpu_data = {
        .shift = 16,
 };
 
@@ -421,7 +421,7 @@ static const __initconst struct of_device_id clk_div_match[] = {
 
 /* Matches for mux clocks */
 static const __initconst struct of_device_id clk_mux_match[] = {
-       {.compatible = "allwinner,sun4i-cpu-clk", .data = &cpu_data,},
+       {.compatible = "allwinner,sun4i-cpu-clk", .data = &this_cpu_data,},
        {.compatible = "allwinner,sun4i-apb1-mux-clk", .data = &apb1_mux_data,},
        {}
 };

ciao
cate

maintainer
#1 lore raw

PATCH 1/1 clk: sunxi: "cpu_data" is defined in header files of some architectures

From: "Giacomo A. Catenazzi" <[email protected]>

In some architectures, the #define cpu_data is not a "macro-function", so the compiler will substitute the identifier with probably something wrong.

[emilio at elopez.com.ar: use cpu_mux_data instead of this_cpu_data]

---

Hi Giacomo,

I have taken your patch and resent it to linux-arm-kernel and Mike Turquette this time, but please try to use git send-email on your next patch.

Here is a video from Greg that explains how to use it as well as other things (checkpatch.pl, get_maintainer.pl, etc)

http://www.youtube.com/watch?v=LLBrBBImJt4

Thanks! :)

Emilio

 drivers/clk/sunxi/clk-sunxi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/sunxi/clk-sunxi.c +2 -2
index 930d36f..412912b 100644
@@ -239,7 +239,7 @@ struct mux_data {
 	u8 shift;
 };
 
-static const __initconst struct mux_data cpu_data = {
+static const __initconst struct mux_data cpu_mux_data = {
 	.shift = 16,
 };
 
@@ -433,7 +433,7 @@ static const __initconst struct of_device_id clk_div_match[] = {
 
 /* Matches for mux clocks */
 static const __initconst struct of_device_id clk_mux_match[] = {
-	{.compatible = "allwinner,sun4i-cpu-clk", .data = &cpu_data,},
+	{.compatible = "allwinner,sun4i-cpu-clk", .data = &cpu_mux_data,},
 	{.compatible = "allwinner,sun4i-apb1-mux-clk", .data = &apb1_mux_data,},
 	{}
 };
Signature · 1 line
1.8.2.3
#2 lore raw

Re: [PATCH] clk: sunxi: "cpu_data" is defined in header files of some architectures

Quoting Emilio L?pez (2013-05-17 06:43:20)

Quoted 9 lines

From: "Giacomo A. Catenazzi" <[email protected]>

In some architectures, the #define cpu_data is not a "macro-function", so the compiler will substitute the identifier with probably something wrong.

[emilio at elopez.com.ar: use cpu_mux_data instead of this_cpu_data]

Taken into clk-next.

Regards,
Mike

Quoted 44 lines

---

Hi Giacomo,

I have taken your patch and resent it to linux-arm-kernel and Mike Turquette this time, but please try to use git send-email on your next patch.

Here is a video from Greg that explains how to use it as well as other things (checkpatch.pl, get_maintainer.pl, etc)

http://www.youtube.com/watch?v=LLBrBBImJt4

Thanks! :)

Emilio

 drivers/clk/sunxi/clk-sunxi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/sunxi/clk-sunxi.c +2 -2
index 930d36f..412912b 100644
@@ -239,7 +239,7 @@ struct mux_data {
        u8 shift;
 };
 
-static const __initconst struct mux_data cpu_data = {
+static const __initconst struct mux_data cpu_mux_data = {
        .shift = 16,
 };
 
@@ -433,7 +433,7 @@ static const __initconst struct of_device_id clk_div_match[] = {
 
 /* Matches for mux clocks */
 static const __initconst struct of_device_id clk_mux_match[] = {
-       {.compatible = "allwinner,sun4i-cpu-clk", .data = &cpu_data,},
+       {.compatible = "allwinner,sun4i-cpu-clk", .data = &cpu_mux_data,},
        {.compatible = "allwinner,sun4i-apb1-mux-clk", .data = &apb1_mux_data,},
        {}
 };
Signature · 1 line
1.8.2.3