From 7852ee068afe97eec3e955de3c4197aeb4793c52 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 13 Sep 2024 15:44:38 +0200 Subject: um: Remove unused os_process_pc The function is not used anywhere in the codebase. Signed-off-by: Benjamin Berg Link: https://patch.msgid.link/20240913134442.967599-2-benjamin@sipsolutions.net Signed-off-by: Johannes Berg --- arch/um/include/shared/os.h | 1 - arch/um/os-Linux/process.c | 33 --------------------------------- 2 files changed, 34 deletions(-) (limited to 'arch/um') diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 9a039d6f1f74..c8c1a93c8d2c 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -199,7 +199,6 @@ extern int create_mem_file(unsigned long long len); extern void report_enomem(void); /* process.c */ -extern unsigned long os_process_pc(int pid); extern int os_process_parent(int pid); extern void os_alarm_process(int pid); extern void os_stop_process(int pid); diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index e52dd37ddadc..6b74a8d91e06 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -18,44 +18,11 @@ #include #include -#define ARBITRARY_ADDR -1 #define FAILURE_PID -1 #define STAT_PATH_LEN sizeof("/proc/#######/stat\0") #define COMM_SCANF "%*[^)])" -unsigned long os_process_pc(int pid) -{ - char proc_stat[STAT_PATH_LEN], buf[256]; - unsigned long pc = ARBITRARY_ADDR; - int fd, err; - - sprintf(proc_stat, "/proc/%d/stat", pid); - fd = open(proc_stat, O_RDONLY, 0); - if (fd < 0) { - printk(UM_KERN_ERR "os_process_pc - couldn't open '%s', " - "errno = %d\n", proc_stat, errno); - goto out; - } - CATCH_EINTR(err = read(fd, buf, sizeof(buf))); - if (err < 0) { - printk(UM_KERN_ERR "os_process_pc - couldn't read '%s', " - "err = %d\n", proc_stat, errno); - goto out_close; - } - os_close_file(fd); - pc = ARBITRARY_ADDR; - if (sscanf(buf, "%*d " COMM_SCANF " %*c %*d %*d %*d %*d %*d %*d %*d " - "%*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d " - "%*d %*d %*d %*d %*d %lu", &pc) != 1) - printk(UM_KERN_ERR "os_process_pc - couldn't find pc in '%s'\n", - buf); - out_close: - close(fd); - out: - return pc; -} - int os_process_parent(int pid) { char stat[STAT_PATH_LEN]; -- cgit v1.2.3-70-g09d2