iommu/omap: Fix debugfs_create_*() usage

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/f18affbea8f7aebb235bfdaf3ad4c307aa5f3d64
Commit:     f18affbea8f7aebb235bfdaf3ad4c307aa5f3d64
Parent:     a8750ddca918032d6349adbf9a4b6555e7db20da
Refname:    refs/heads/master
Author:     Geert Uytterhoeven <[email protected]>
AuthorDate: Tue Jan 2 16:29:45 2018 +0100
Committer:  Joerg Roedel <[email protected]>
CommitDate: Wed Jan 17 14:23:33 2018 +0100

    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: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
---
 drivers/iommu/omap-iommu-debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index 505548aafeff..50217548c3b8 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -274,8 +274,8 @@ void omap_iommu_debugfs_add(struct omap_iommu *obj)
 	if (!obj->debug_dir)
 		return;
 
-	d = debugfs_create_u8("nr_tlb_entries", 0400, obj->debug_dir,
-			      (u8 *)&obj->nr_tlb_entries);
+	d = debugfs_create_u32("nr_tlb_entries", 0400, obj->debug_dir,
+			       &obj->nr_tlb_entries);
 	if (!d)
 		return;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.