* [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
@ 2018-01-02 15:25 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2018-01-02 15:25 UTC (permalink / raw)
To: Paul Walmsley, Aaro Koskinen, Tony Lindgren
Cc: linux-omap, linux-arm-kernel, linux-clk, Geert Uytterhoeven
When exposing data access through debugfs, the correct
debugfs_create_*() functions must be used, depending on data type.
Remove all casts from data pointers passed to debugfs_create_*()
functions, as such casts prevent the compiler from flagging bugs.
Correct all wrong usage:
- clk.rate is unsigned long, not u32,
- clk.flags is u8, not u32, which exposed the successive
clk.rate_offset and clk.src_offset fields.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
arch/arm/mach-omap1/clock.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 43e3e188f5213418..fa512413a4717221 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -1011,17 +1011,17 @@ static int clk_debugfs_register_one(struct clk *c)
return -ENOMEM;
c->dent = d;
- d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
+ d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount);
if (!d) {
err = -ENOMEM;
goto err_out;
}
- d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+ d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate);
if (!d) {
err = -ENOMEM;
goto err_out;
}
- d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
+ d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags);
if (!d) {
err = -ENOMEM;
goto err_out;
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
@ 2018-01-02 15:25 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2018-01-02 15:25 UTC (permalink / raw)
To: linux-arm-kernel
When exposing data access through debugfs, the correct
debugfs_create_*() functions must be used, depending on data type.
Remove all casts from data pointers passed to debugfs_create_*()
functions, as such casts prevent the compiler from flagging bugs.
Correct all wrong usage:
- clk.rate is unsigned long, not u32,
- clk.flags is u8, not u32, which exposed the successive
clk.rate_offset and clk.src_offset fields.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
arch/arm/mach-omap1/clock.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 43e3e188f5213418..fa512413a4717221 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -1011,17 +1011,17 @@ static int clk_debugfs_register_one(struct clk *c)
return -ENOMEM;
c->dent = d;
- d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
+ d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount);
if (!d) {
err = -ENOMEM;
goto err_out;
}
- d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+ d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate);
if (!d) {
err = -ENOMEM;
goto err_out;
}
- d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
+ d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags);
if (!d) {
err = -ENOMEM;
goto err_out;
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
2018-01-02 15:25 ` Geert Uytterhoeven
(?)
@ 2018-01-09 17:37 ` Aaro Koskinen
-1 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2018-01-09 17:37 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tony Lindgren, Paul Walmsley, linux-omap, linux-clk, linux-arm-kernel
Hi,
On Tue, Jan 02, 2018 at 04:25:35PM +0100, Geert Uytterhoeven wrote:
> When exposing data access through debugfs, the correct
> debugfs_create_*() functions must be used, depending on data type.
>
> Remove all casts from data pointers passed to debugfs_create_*()
> functions, as such casts prevent the compiler from flagging bugs.
>
> Correct all wrong usage:
> - clk.rate is unsigned long, not u32,
> - clk.flags is u8, not u32, which exposed the successive
> clk.rate_offset and clk.src_offset fields.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
A.
> ---
> Compile-tested only.
> ---
> arch/arm/mach-omap1/clock.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
> index 43e3e188f5213418..fa512413a4717221 100644
> --- a/arch/arm/mach-omap1/clock.c
> +++ b/arch/arm/mach-omap1/clock.c
> @@ -1011,17 +1011,17 @@ static int clk_debugfs_register_one(struct clk *c)
> return -ENOMEM;
> c->dent = d;
>
> - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
> + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> }
> - d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
> + d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> }
> - d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
> + d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> --
> 2.7.4
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
@ 2018-01-09 17:37 ` Aaro Koskinen
0 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2018-01-09 17:37 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tony Lindgren, Paul Walmsley, linux-omap, linux-clk, linux-arm-kernel
Hi,
On Tue, Jan 02, 2018 at 04:25:35PM +0100, Geert Uytterhoeven wrote:
> When exposing data access through debugfs, the correct
> debugfs_create_*() functions must be used, depending on data type.
>
> Remove all casts from data pointers passed to debugfs_create_*()
> functions, as such casts prevent the compiler from flagging bugs.
>
> Correct all wrong usage:
> - clk.rate is unsigned long, not u32,
> - clk.flags is u8, not u32, which exposed the successive
> clk.rate_offset and clk.src_offset fields.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
A.
> ---
> Compile-tested only.
> ---
> arch/arm/mach-omap1/clock.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
> index 43e3e188f5213418..fa512413a4717221 100644
> --- a/arch/arm/mach-omap1/clock.c
> +++ b/arch/arm/mach-omap1/clock.c
> @@ -1011,17 +1011,17 @@ static int clk_debugfs_register_one(struct clk *c)
> return -ENOMEM;
> c->dent = d;
>
> - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
> + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> }
> - d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
> + d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> }
> - d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
> + d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
@ 2018-01-09 17:37 ` Aaro Koskinen
0 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2018-01-09 17:37 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Jan 02, 2018 at 04:25:35PM +0100, Geert Uytterhoeven wrote:
> When exposing data access through debugfs, the correct
> debugfs_create_*() functions must be used, depending on data type.
>
> Remove all casts from data pointers passed to debugfs_create_*()
> functions, as such casts prevent the compiler from flagging bugs.
>
> Correct all wrong usage:
> - clk.rate is unsigned long, not u32,
> - clk.flags is u8, not u32, which exposed the successive
> clk.rate_offset and clk.src_offset fields.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
A.
> ---
> Compile-tested only.
> ---
> arch/arm/mach-omap1/clock.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
> index 43e3e188f5213418..fa512413a4717221 100644
> --- a/arch/arm/mach-omap1/clock.c
> +++ b/arch/arm/mach-omap1/clock.c
> @@ -1011,17 +1011,17 @@ static int clk_debugfs_register_one(struct clk *c)
> return -ENOMEM;
> c->dent = d;
>
> - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
> + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> }
> - d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
> + d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> }
> - d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
> + d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
2018-01-09 17:37 ` Aaro Koskinen
@ 2018-02-14 16:22 ` Tony Lindgren
-1 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2018-02-14 16:22 UTC (permalink / raw)
To: Aaro Koskinen
Cc: Geert Uytterhoeven, Paul Walmsley, linux-omap, linux-arm-kernel,
linux-clk
* Aaro Koskinen <aaro.koskinen@iki.fi> [180109 17:40]:
> Hi,
>
> On Tue, Jan 02, 2018 at 04:25:35PM +0100, Geert Uytterhoeven wrote:
> > When exposing data access through debugfs, the correct
> > debugfs_create_*() functions must be used, depending on data type.
> >
> > Remove all casts from data pointers passed to debugfs_create_*()
> > functions, as such casts prevent the compiler from flagging bugs.
> >
> > Correct all wrong usage:
> > - clk.rate is unsigned long, not u32,
> > - clk.flags is u8, not u32, which exposed the successive
> > clk.rate_offset and clk.src_offset fields.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Applying into omap-for-v4.16/fixes thanks.
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage
@ 2018-02-14 16:22 ` Tony Lindgren
0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2018-02-14 16:22 UTC (permalink / raw)
To: linux-arm-kernel
* Aaro Koskinen <aaro.koskinen@iki.fi> [180109 17:40]:
> Hi,
>
> On Tue, Jan 02, 2018 at 04:25:35PM +0100, Geert Uytterhoeven wrote:
> > When exposing data access through debugfs, the correct
> > debugfs_create_*() functions must be used, depending on data type.
> >
> > Remove all casts from data pointers passed to debugfs_create_*()
> > functions, as such casts prevent the compiler from flagging bugs.
> >
> > Correct all wrong usage:
> > - clk.rate is unsigned long, not u32,
> > - clk.flags is u8, not u32, which exposed the successive
> > clk.rate_offset and clk.src_offset fields.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Applying into omap-for-v4.16/fixes thanks.
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-02-14 16:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 15:25 [PATCH] ARM: OMAP: clock: Fix debugfs_create_*() usage Geert Uytterhoeven
2018-01-02 15:25 ` Geert Uytterhoeven
2018-01-09 17:37 ` Aaro Koskinen
2018-01-09 17:37 ` Aaro Koskinen
2018-01-09 17:37 ` Aaro Koskinen
2018-02-14 16:22 ` Tony Lindgren
2018-02-14 16:22 ` Tony Lindgren
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.