From patchwork Tue Jan 2 15:29:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10140917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1F706034B for ; Tue, 2 Jan 2018 15:29:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C11728B7F for ; Tue, 2 Jan 2018 15:29:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DA6D28BA5; Tue, 2 Jan 2018 15:29:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24FEB28B7F for ; Tue, 2 Jan 2018 15:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751549AbeABP3u (ORCPT ); Tue, 2 Jan 2018 10:29:50 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51198 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751532AbeABP3r (ORCPT ); Tue, 2 Jan 2018 10:29:47 -0500 Received: from ayla.of.borg ([84.195.106.246]) by andre.telenet-ops.be with bizsmtp id tTVm1w01M5JzmfG01TVmwh; Tue, 02 Jan 2018 16:29:46 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1eWOVe-0001Ke-8Y; Tue, 02 Jan 2018 16:29:46 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1eWOVe-0002XL-7n; Tue, 02 Jan 2018 16:29:46 +0100 From: Geert Uytterhoeven To: Joerg Roedel , iommu@lists.linux-foundation.org, Tony Lindgren Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] iommu/omap: Fix debugfs_create_*() usage Date: Tue, 2 Jan 2018 16:29:45 +0100 Message-Id: <1514906985-9712-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Compile-tested only. --- 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 505548aafeff2276..50217548c3b8e7af 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;