summaryrefslogtreecommitdiffstats
path: root/tools/thermal/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:40:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:40:19 +0000
commit9f0fc191371843c4fc000a226b0a26b6c059aacd (patch)
tree35f8be3ef04506ac891ad001e8c41e535ae8d01d /tools/thermal/lib
parentReleasing progress-linux version 6.6.15-2~progress7.99u1. (diff)
downloadlinux-9f0fc191371843c4fc000a226b0a26b6c059aacd.tar.xz
linux-9f0fc191371843c4fc000a226b0a26b6c059aacd.zip
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/thermal/lib')
-rw-r--r--tools/thermal/lib/mainloop.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/thermal/lib/mainloop.c b/tools/thermal/lib/mainloop.c
index 94cbbcbd1..bf4c1b730 100644
--- a/tools/thermal/lib/mainloop.c
+++ b/tools/thermal/lib/mainloop.c
@@ -9,7 +9,6 @@
#include "log.h"
static int epfd = -1;
-static unsigned short nrhandler;
static sig_atomic_t exit_mainloop;
struct mainloop_data {
@@ -18,8 +17,6 @@ struct mainloop_data {
int fd;
};
-static struct mainloop_data **mds;
-
#define MAX_EVENTS 10
int mainloop(unsigned int timeout)
@@ -61,13 +58,6 @@ int mainloop_add(int fd, mainloop_callback_t cb, void *data)
struct mainloop_data *md;
- if (fd >= nrhandler) {
- mds = realloc(mds, sizeof(*mds) * (fd + 1));
- if (!mds)
- return -1;
- nrhandler = fd + 1;
- }
-
md = malloc(sizeof(*md));
if (!md)
return -1;
@@ -76,7 +66,6 @@ int mainloop_add(int fd, mainloop_callback_t cb, void *data)
md->cb = cb;
md->fd = fd;
- mds[fd] = md;
ev.data.ptr = md;
if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &ev) < 0) {
@@ -89,14 +78,9 @@ int mainloop_add(int fd, mainloop_callback_t cb, void *data)
int mainloop_del(int fd)
{
- if (fd >= nrhandler)
- return -1;
-
if (epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL) < 0)
return -1;
- free(mds[fd]);
-
return 0;
}