]> sourceware.org Git - systemtap.git/commitdiff
Remove unneeded parameter in _stp_create_procfs() from runtime/procfs.c
authorDavid Smith <dsmith@redhat.com>
Wed, 12 Oct 2016 18:14:26 +0000 (13:14 -0500)
committerDavid Smith <dsmith@redhat.com>
Wed, 12 Oct 2016 18:14:26 +0000 (13:14 -0500)
* runtime/procfs.c (_stp_create_procfs): Remove unneeded 'num' parameter.
* tapset-procfs.cxx (procfs_derived_probe_group::emit_module_init): Update
  _stp_create_procfs() function call.

runtime/procfs.c
tapset-procfs.cxx

index 8e3840895a8efaa04c391b63d7f7e3f7fd0562be..66dd709734214e3cf4ae1c5a2b08e2a3bb473a40 100644 (file)
@@ -186,18 +186,15 @@ static struct proc_dir_entry *_stp_procfs_lookup(const char *dir, struct proc_di
 #endif /* _STP_ALLOW_PROCFS_PATH_SUBDIRS */
 
 
-static int _stp_create_procfs(const char *path, int num,
+static int _stp_create_procfs(const char *path,
                              const struct file_operations *fops, int perm,
                              void *data) 
 {  
        const char *p; char *next;
        struct proc_dir_entry *last_dir, *de;
 
-       if (num >= STP_MAX_PROCFS_FILES) {
-               _stp_error("Requested file number %d is larger than max (%d)\n", 
-                          num, STP_MAX_PROCFS_FILES);
-               return -1;
-       }
+       if (_stp_num_pde >= STP_MAX_PROCFS_FILES)
+               goto too_many;
 
        last_dir = _stp_proc_root;
 
index 52586a100401e006bd86b1944c1ea44bae0c4398..288ddab438531fbd6563a58f072f7a7f23d38e85 100644 (file)
@@ -379,7 +379,7 @@ procfs_derived_probe_group::emit_module_init (systemtap_session& s)
   s.op->indent(-1);
 
   s.op->newline() << "_spp_init(spp);";
-  s.op->newline() << "rc = _stp_create_procfs(spp->path, i, &_stp_proc_fops, spp->permissions, spp);";
+  s.op->newline() << "rc = _stp_create_procfs(spp->path, &_stp_proc_fops, spp->permissions, spp);";
 
   s.op->newline() << "if (rc) {";
   s.op->newline(1) << "_stp_close_procfs();";
This page took 0.033772 seconds and 5 git commands to generate.