hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/mali_kbase_mem_profile_debugfs.c
....@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
22 /*
33 *
4
- * (C) COPYRIGHT 2012-2017, 2019-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2012-2017, 2019-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -24,13 +24,13 @@
2424 #if IS_ENABLED(CONFIG_DEBUG_FS)
2525
2626 /**
27
- * Show callback for the @c mem_profile debugfs file.
28
- *
29
- * This function is called to get the contents of the @c mem_profile debugfs
30
- * file. This is a report of current memory usage and distribution in userspace.
27
+ * kbasep_mem_profile_seq_show - Show callback for the @c mem_profile debugfs file.
3128 *
3229 * @sfile: The debugfs entry
3330 * @data: Data associated with the entry
31
+ *
32
+ * This function is called to get the contents of the @c mem_profile debugfs
33
+ * file. This is a report of current memory usage and distribution in userspace.
3434 *
3535 * Return: 0 if it successfully prints data in debugfs entry file, non-zero
3636 * otherwise
....@@ -69,11 +69,7 @@
6969 int kbasep_mem_profile_debugfs_insert(struct kbase_context *kctx, char *data,
7070 size_t size)
7171 {
72
-#if (KERNEL_VERSION(4, 7, 0) <= LINUX_VERSION_CODE)
7372 const mode_t mode = 0444;
74
-#else
75
- const mode_t mode = 0400;
76
-#endif
7773 int err = 0;
7874
7975 mutex_lock(&kctx->mem_profile_lock);
....@@ -84,9 +80,9 @@
8480 if (!kbase_ctx_flag(kctx, KCTX_MEM_PROFILE_INITIALIZED)) {
8581 if (IS_ERR_OR_NULL(kctx->kctx_dentry)) {
8682 err = -ENOMEM;
87
- } else if (!debugfs_create_file("mem_profile", mode,
88
- kctx->kctx_dentry, kctx,
89
- &kbasep_mem_profile_debugfs_fops)) {
83
+ } else if (IS_ERR_OR_NULL(debugfs_create_file("mem_profile",
84
+ mode, kctx->kctx_dentry, kctx,
85
+ &kbasep_mem_profile_debugfs_fops))) {
9086 err = -EAGAIN;
9187 } else {
9288 kbase_ctx_flag_set(kctx,