5
5
#include <linux/kernel.h>
6
6
#include <sys/mount.h>
7
7
8
- static int debugfs_premounted ;
9
8
char debugfs_mountpoint [PATH_MAX + 1 ] = "/sys/kernel/debug" ;
10
9
char tracing_events_path [PATH_MAX + 1 ] = "/sys/kernel/debug/tracing/events" ;
11
10
@@ -15,7 +14,7 @@ static const char *debugfs_known_mountpoints[] = {
15
14
0 ,
16
15
};
17
16
18
- static int debugfs_found ;
17
+ static bool debugfs_found ;
19
18
20
19
/* find the path to the mounted debugfs */
21
20
const char * debugfs_find_mountpoint (void )
@@ -30,7 +29,7 @@ const char *debugfs_find_mountpoint(void)
30
29
ptr = debugfs_known_mountpoints ;
31
30
while (* ptr ) {
32
31
if (debugfs_valid_mountpoint (* ptr ) == 0 ) {
33
- debugfs_found = 1 ;
32
+ debugfs_found = true ;
34
33
strcpy (debugfs_mountpoint , * ptr );
35
34
return debugfs_mountpoint ;
36
35
}
@@ -52,7 +51,7 @@ const char *debugfs_find_mountpoint(void)
52
51
if (strcmp (type , "debugfs" ) != 0 )
53
52
return NULL ;
54
53
55
- debugfs_found = 1 ;
54
+ debugfs_found = true ;
56
55
57
56
return debugfs_mountpoint ;
58
57
}
@@ -82,10 +81,8 @@ static void debugfs_set_tracing_events_path(const char *mountpoint)
82
81
char * debugfs_mount (const char * mountpoint )
83
82
{
84
83
/* see if it's already mounted */
85
- if (debugfs_find_mountpoint ()) {
86
- debugfs_premounted = 1 ;
84
+ if (debugfs_find_mountpoint ())
87
85
goto out ;
88
- }
89
86
90
87
/* if not mounted and no argument */
91
88
if (mountpoint == NULL ) {
@@ -100,7 +97,7 @@ char *debugfs_mount(const char *mountpoint)
100
97
return NULL ;
101
98
102
99
/* save the mountpoint */
103
- debugfs_found = 1 ;
100
+ debugfs_found = true ;
104
101
strncpy (debugfs_mountpoint , mountpoint , sizeof (debugfs_mountpoint ));
105
102
out :
106
103
debugfs_set_tracing_events_path (debugfs_mountpoint );
0 commit comments