提交 f18affbe 编写于 作者: G Geert Uytterhoeven 提交者: Joerg Roedel

iommu/omap: 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.

omap_iommu.nr_tlb_entries is "int", hence casting to "u8 *" exposes only
a part of it.  Fix this by using debugfs_create_u32() instead.
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
上级 a8750ddc
...@@ -274,8 +274,8 @@ void omap_iommu_debugfs_add(struct omap_iommu *obj) ...@@ -274,8 +274,8 @@ void omap_iommu_debugfs_add(struct omap_iommu *obj)
if (!obj->debug_dir) if (!obj->debug_dir)
return; return;
d = debugfs_create_u8("nr_tlb_entries", 0400, obj->debug_dir, d = debugfs_create_u32("nr_tlb_entries", 0400, obj->debug_dir,
(u8 *)&obj->nr_tlb_entries); &obj->nr_tlb_entries);
if (!d) if (!d)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册