From 281c37d1cdc467f2a9edb7a5f991893e97f1f422 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Sun, 29 Sep 2019 00:00:00 -0500 Subject: [PATCH] library: removed that 'simple_readtask' unused pointer This patch just eliminates a parameter present for the simple_readtask() function which is not needed nor has it ever actually been used. It will make calls to that function (via taskreader ptr) slightly more efficient. Signed-off-by: Jim Warner --- proc/readproc.c | 6 ++---- proc/readproc.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/proc/readproc.c b/proc/readproc.c index 5c89ce56..87ab14f0 100644 --- a/proc/readproc.c +++ b/proc/readproc.c @@ -1132,10 +1132,9 @@ next_proc: ////////////////////////////////////////////////////////////////////////////////// // This reads /proc/*/task/* data, for one task. -// p is the POSIX process (task group leader, not needed by THIS implementation) // t is the POSIX thread (task group member, generally not the leader) // path is a path to the task, with some room to spare. -static proc_t* simple_readtask(PROCTAB *restrict const PT, const proc_t *restrict const p, proc_t *restrict const t, char *restrict const path) { +static proc_t* simple_readtask(PROCTAB *restrict const PT, proc_t *restrict const t, char *restrict const path) { static struct utlbuf_s ub = { NULL, 0 }; // buf for stat,statm,status static struct stat sb; // stat() buffer unsigned flags = PT->flags; @@ -1239,7 +1238,6 @@ static proc_t* simple_readtask(PROCTAB *restrict const PT, const proc_t *restric errno = ENOMEM; next_task: return NULL; - (void)p; } @@ -1378,7 +1376,7 @@ next_proc: next_task: // fills in our path, plus x->tid and x->tgid if ((!(PT->taskfinder(PT,&skel_p,x,path))) // simple_nexttid - || (!(ret = PT->taskreader(PT,new_p,x,path)))) { // simple_readtask + || (!(ret = PT->taskreader(PT,x,path)))) { // simple_readtask goto next_proc; } if (!new_p) { diff --git a/proc/readproc.h b/proc/readproc.h index c3be9635..0d07c750 100644 --- a/proc/readproc.h +++ b/proc/readproc.h @@ -172,7 +172,7 @@ typedef struct PROCTAB { int(*finder)(struct PROCTAB *__restrict const, proc_t *__restrict const); proc_t*(*reader)(struct PROCTAB *__restrict const, proc_t *__restrict const); int(*taskfinder)(struct PROCTAB *__restrict const, const proc_t *__restrict const, proc_t *__restrict const, char *__restrict const); - proc_t*(*taskreader)(struct PROCTAB *__restrict const, const proc_t *__restrict const, proc_t *__restrict const, char *__restrict const); + proc_t*(*taskreader)(struct PROCTAB *__restrict const, proc_t *__restrict const, char *__restrict const); pid_t* pids; // pids of the procs uid_t* uids; // uids of procs int nuid; // cannot really sentinel-terminate unsigned short[] -- 2.40.0