Skip to content

Commit bd0c48e

Browse files
committed
drivers: habanalabs: remove unused dentry pointer for debugfs files
The dentry for the created debugfs file was being saved, but never used anywhere. As the pointer isn't needed for anything, and the debugfs files are being properly removed by removing the parent directory, remove the saved pointer as well, saving a tiny bit of memory and logic. Cc: Oded Gabbay <ogabbay@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Tomer Tayar <ttayar@habana.ai> Cc: Moti Haimovski <mhaimovski@habana.ai> Cc: Omer Shpigelman <oshpigelman@habana.ai> Cc: Ofir Bitton <obitton@habana.ai> Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
1 parent 16db6b5 commit bd0c48e

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/misc/habanalabs/common/debugfs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ void hl_debugfs_add_device(struct hl_device *hdev)
992992
struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs;
993993
int count = ARRAY_SIZE(hl_debugfs_list);
994994
struct hl_debugfs_entry *entry;
995-
struct dentry *ent;
996995
int i;
997996

998997
dev_entry->hdev = hdev;
@@ -1105,13 +1104,11 @@ void hl_debugfs_add_device(struct hl_device *hdev)
11051104
&hl_security_violations_fops);
11061105

11071106
for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) {
1108-
1109-
ent = debugfs_create_file(hl_debugfs_list[i].name,
1107+
debugfs_create_file(hl_debugfs_list[i].name,
11101108
0444,
11111109
dev_entry->root,
11121110
entry,
11131111
&hl_debugfs_fops);
1114-
entry->dent = ent;
11151112
entry->info_ent = &hl_debugfs_list[i];
11161113
entry->dev_entry = dev_entry;
11171114
}

drivers/misc/habanalabs/common/habanalabs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,12 +1465,10 @@ struct hl_info_list {
14651465

14661466
/**
14671467
* struct hl_debugfs_entry - debugfs dentry wrapper.
1468-
* @dent: base debugfs entry structure.
14691468
* @info_ent: dentry realted ops.
14701469
* @dev_entry: ASIC specific debugfs manager.
14711470
*/
14721471
struct hl_debugfs_entry {
1473-
struct dentry *dent;
14741472
const struct hl_info_list *info_ent;
14751473
struct hl_dbg_device_entry *dev_entry;
14761474
};

0 commit comments

Comments
 (0)