From patchwork Fri Jun 1 11:10:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 10443207 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 73868602BC for ; Fri, 1 Jun 2018 12:22:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63A9128C40 for ; Fri, 1 Jun 2018 12:22:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57CD828D8D; Fri, 1 Jun 2018 12:22:28 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D06C128C40 for ; Fri, 1 Jun 2018 12:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vupJP1G3TTxKY2S8AnjfFicgnLzyMN0bV1wuXWKG1tY=; b=FO0xYNc9wJTvJPwS79lzEZp4Uo wq9FOrLVZ4IsdvuqtNkpThdtpcvVIc3uDo/puJL0QKVwkWuSSSriUCkdAPSYxS11+BBP0OQewhfbN RjEMS4uj+QAx1fE7iRxZWNp2BglO2F2+5UTjk/mocXIgy7Ja2k5PQoJdugFd3BN5USYMQMoAODSY9 Gr/1rPLwaSftsR5P1n6EYf9bhT2DJeU9Hhsz25QIm7jdQDAF6UN5ywok9ieOFyXu3jYFu8Y4e2rNB QEpGta1JHcrtniIMYha9ykp7leCJkVck5AOu69+Vq4+shyeBsYSy7r1ykUsVfNGw6+gFdp+kaVoo0 vSf6PJhA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOj4T-0001UL-HU; Fri, 01 Jun 2018 12:22:17 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOio8-0005uq-9c; Fri, 01 Jun 2018 12:05:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bf3d9+5S3sJG42W0mZW3IV/qbB2rzdFDNGFeuH+Oi+s=; b=DcX+eOH6vj9M1F5YP7j7tpyMk o5r6/eP3dCzLhoPHLyehrBg+qDHkfYQqF5v8LdAUJkSYBXoS880Duyp0pLVudDchUhnBdyHOid2xR lFnOZwgn4FpyPW5RmeaihrTshhkDvu02rxo+iadAV4pJttsq/8Ah2iRyLYC+bnLQUhvXeJ6L4Tn6r dPzBAt99SrrSbnnZRw9pDOuI6FUIHcgylRHxrKfBgQsu7XhAFo6lWy92QlYT6jDLR7v8/fNAlrGyt rQZ7/pgWA/VlK1f+sybdQ5JhrpjT0e8kR/3hjsZ/QovuJUOpqyjXkJl5xr/eHdU7ZO1E1LuGf4Nz5 znHU1NueQ==; Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOhxd-0000DE-VM; Fri, 01 Jun 2018 11:11:13 +0000 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F386208B5; Fri, 1 Jun 2018 11:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527851449; bh=GvYFHhcbxR2CysF3H4OSaCGKL8EWxe2bjq0zU5diN4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYztrfk0+fePCigmL17G6yoxzgRdT01UxIDX6VHWfp3RV1yR8d4VuPvAKUrGLOYFy V5yaZTQrVvzbHfIrLoErVMvWVuJMcjpmKKomRkI92Bbmz7Cu8RgJ2kpd5yLuCGj9wn Zy5MJsjaKN07EAAx/yXGoy6BscRhPygvoQY+fUZk= From: Greg Kroah-Hartman To: devel@driverdev.osuosl.org Subject: [PATCH 6/6] staging: vc04_services: no need to save the log debufs dentries Date: Fri, 1 Jun 2018 13:10:04 +0200 Message-Id: <20180601111004.1670-6-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180601111004.1670-1-gregkh@linuxfoundation.org> References: <20180601111004.1670-1-gregkh@linuxfoundation.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180601_071110_233189_35D5CC80 X-CRM114-Status: GOOD ( 18.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Wahren , Kees Cook , Arnd Bergmann , Greg Kroah-Hartman , Keerthi Reddy , linux-rpi-kernel@lists.infradead.org, Dan Carpenter , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The log entry dentries are only set, never referenced, so no need to keep them around. Remove the pointer from struct vchiq_debugfs_log_entry as it is not needed anymore and get rid of the separate vchiq_debugfs_create_log_entries() function as it is only used in one place. Suggested-by: Eric Anholt Cc: Stefan Wahren Cc: Kees Cook Cc: Dan Carpenter Cc: Arnd Bergmann Cc: Keerthi Reddy Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_debugfs.c | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c index 2b353d2d25ce..38805504d462 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c @@ -59,7 +59,6 @@ struct dentry *vchiq_dbg_clients; struct vchiq_debugfs_log_entry { const char *name; void *plevel; - struct dentry *dir; }; static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = { @@ -144,23 +143,6 @@ static const struct file_operations debugfs_log_fops = { .release = single_release, }; -/* create an entry under /vchiq/log for each log category */ -static void vchiq_debugfs_create_log_entries(struct dentry *top) -{ - struct dentry *dir; - size_t i; - - dir = debugfs_create_dir("log", vchiq_dbg_dir); - - for (i = 0; i < n_log_entries; i++) { - dir = debugfs_create_file(vchiq_debugfs_log_entries[i].name, - 0644, dir, - vchiq_debugfs_log_entries[i].plevel, - &debugfs_log_fops); - vchiq_debugfs_log_entries[i].dir = dir; - } -} - static int debugfs_usecount_show(struct seq_file *f, void *offset) { VCHIQ_INSTANCE_T instance = f->private; @@ -268,10 +250,19 @@ void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance) void vchiq_debugfs_init(void) { + struct dentry *dir; + int i; + vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL); vchiq_dbg_clients = debugfs_create_dir("clients", vchiq_dbg_dir); - vchiq_debugfs_create_log_entries(vchiq_dbg_dir); + /* create an entry under /vchiq/log for each log category */ + dir = debugfs_create_dir("log", vchiq_dbg_dir); + + for (i = 0; i < n_log_entries; i++) + debugfs_create_file(vchiq_debugfs_log_entries[i].name, 0644, + dir, vchiq_debugfs_log_entries[i].plevel, + &debugfs_log_fops); } /* remove all the debugfs entries */