Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: OMAP1: clock: Fix debugfs_create_*() usage

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>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

Geert Uytterhoeven and committed by
Tony Lindgren
8cbbf174 fe27f167

+3 -3
+3 -3
arch/arm/mach-omap1/clock.c
··· 1011 1011 return -ENOMEM; 1012 1012 c->dent = d; 1013 1013 1014 - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount); 1014 + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount); 1015 1015 if (!d) { 1016 1016 err = -ENOMEM; 1017 1017 goto err_out; 1018 1018 } 1019 - d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 1019 + d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate); 1020 1020 if (!d) { 1021 1021 err = -ENOMEM; 1022 1022 goto err_out; 1023 1023 } 1024 - d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags); 1024 + d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags); 1025 1025 if (!d) { 1026 1026 err = -ENOMEM; 1027 1027 goto err_out;